Commit 4cbf02bf authored by Tiger Oakes's avatar Tiger Oakes Committed by Commit Bot

Removed context#getApplicationContext calls from /content/public/android

Continuation of work in bug 646094.

This CL was uploaded by git cl split.

R=dtrainor@chromium.org

Bug: 846456
Change-Id: Ied7851bf95858ac7c9580c028cb11cf2b8290374
Reviewed-on: https://chromium-review.googlesource.com/1095984Reviewed-by: default avatarSimeon Anfinrud <sanfin@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Tiger Oakes <tigero@google.com>
Cr-Commit-Position: refs/heads/master@{#570827}
parent 4f4fa35a
...@@ -227,7 +227,7 @@ public class ChromeBrowserInitializer { ...@@ -227,7 +227,7 @@ public class ChromeBrowserInitializer {
warmUpSharedPrefs(); warmUpSharedPrefs();
DeviceUtils.addDeviceSpecificUserAgentSwitch(mApplication); DeviceUtils.addDeviceSpecificUserAgentSwitch();
ApplicationStatus.registerStateListenerForAllActivities( ApplicationStatus.registerStateListenerForAllActivities(
createActivityStateListener()); createActivityStateListener());
......
...@@ -46,7 +46,7 @@ public class CastBrowserHelper { ...@@ -46,7 +46,7 @@ public class CastBrowserHelper {
return CommandLine.getInstance(); return CommandLine.getInstance();
}); });
DeviceUtils.addDeviceSpecificUserAgentSwitch(context); DeviceUtils.addDeviceSpecificUserAgentSwitch();
try { try {
LibraryLoader.getInstance().ensureInitialized(LibraryProcessType.PROCESS_BROWSER); LibraryLoader.getInstance().ensureInitialized(LibraryProcessType.PROCESS_BROWSER);
......
...@@ -395,8 +395,7 @@ public class BrowserStartupControllerImpl implements BrowserStartupController { ...@@ -395,8 +395,7 @@ public class BrowserStartupControllerImpl implements BrowserStartupController {
public void run() { public void run() {
if (!mPostResourceExtractionTasksCompleted) { if (!mPostResourceExtractionTasksCompleted) {
// TODO(yfriedman): Remove dependency on a command line flag for this. // TODO(yfriedman): Remove dependency on a command line flag for this.
DeviceUtilsImpl.addDeviceSpecificUserAgentSwitch( DeviceUtilsImpl.addDeviceSpecificUserAgentSwitch();
ContextUtils.getApplicationContext());
nativeSetCommandLineFlags( nativeSetCommandLineFlags(
singleProcess, nativeIsPluginEnabled() ? getPlugins() : null); singleProcess, nativeIsPluginEnabled() ? getPlugins() : null);
mPostResourceExtractionTasksCompleted = true; mPostResourceExtractionTasksCompleted = true;
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
package org.chromium.content.browser; package org.chromium.content.browser;
import android.content.Context;
import org.chromium.base.CommandLine; import org.chromium.base.CommandLine;
import org.chromium.content_public.common.ContentSwitches; import org.chromium.content_public.common.ContentSwitches;
import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.base.DeviceFormFactor;
...@@ -16,7 +14,7 @@ import org.chromium.ui.base.DeviceFormFactor; ...@@ -16,7 +14,7 @@ import org.chromium.ui.base.DeviceFormFactor;
public class DeviceUtilsImpl { public class DeviceUtilsImpl {
private DeviceUtilsImpl() {} private DeviceUtilsImpl() {}
public static void addDeviceSpecificUserAgentSwitch(Context context) { public static void addDeviceSpecificUserAgentSwitch() {
if (!DeviceFormFactor.isTablet()) { if (!DeviceFormFactor.isTablet()) {
CommandLine.getInstance().appendSwitch(ContentSwitches.USE_MOBILE_UA); CommandLine.getInstance().appendSwitch(ContentSwitches.USE_MOBILE_UA);
} }
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
package org.chromium.content_public.browser; package org.chromium.content_public.browser;
import android.content.Context;
import org.chromium.content.browser.DeviceUtilsImpl; import org.chromium.content.browser.DeviceUtilsImpl;
/** /**
...@@ -16,9 +14,8 @@ public final class DeviceUtils { ...@@ -16,9 +14,8 @@ public final class DeviceUtils {
/** /**
* Appends the switch specifying which user agent should be used for this device. * Appends the switch specifying which user agent should be used for this device.
* @param context The context for the caller activity.
*/ */
public static void addDeviceSpecificUserAgentSwitch(Context context) { public static void addDeviceSpecificUserAgentSwitch() {
DeviceUtilsImpl.addDeviceSpecificUserAgentSwitch(context); DeviceUtilsImpl.addDeviceSpecificUserAgentSwitch();
} }
} }
...@@ -55,7 +55,7 @@ public class ContentShellActivity extends Activity { ...@@ -55,7 +55,7 @@ public class ContentShellActivity extends Activity {
} }
} }
DeviceUtils.addDeviceSpecificUserAgentSwitch(this); DeviceUtils.addDeviceSpecificUserAgentSwitch();
try { try {
LibraryLoader.getInstance().ensureInitialized(LibraryProcessType.PROCESS_BROWSER); LibraryLoader.getInstance().ensureInitialized(LibraryProcessType.PROCESS_BROWSER);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment