Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/DeviceUtils.java

Issue 11066087: Upstream BrowserChildProcessHostImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/DeviceUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/DeviceUtils.java b/content/public/android/java/src/org/chromium/content/browser/DeviceUtils.java
similarity index 60%
rename from chrome/android/java/src/org/chromium/chrome/browser/DeviceUtils.java
rename to content/public/android/java/src/org/chromium/content/browser/DeviceUtils.java
index bfba7ccddcc3bff6aa02d1c1119cfe8379d6f312..aac0ad4bfb5e9e1aefb6bfe69ed8a95be30bcac6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/DeviceUtils.java
+++ b/content/public/android/java/src/org/chromium/content/browser/DeviceUtils.java
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package org.chromium.chrome.browser;
+package org.chromium.content.browser;
import android.content.Context;
+import org.chromium.content.common.CommandLine;
+
/**
* A utility class that has helper methods for device configuration.
*/
@@ -25,4 +27,15 @@ public class DeviceUtils {
return minimumScreenWidthDp >= MINIMUM_TABLET_WIDTH_DP;
}
+ /**
+ * Appends the switch specifying which user agent should be used for this device.
+ * @param contex The context for the caller activity.
+ */
+ public static void addDeviceSpecificUserAgentSwitch(Context context) {
+ if (isTablet(context)) {
+ CommandLine.getInstance().appendSwitch(CommandLine.TABLET_UI);
+ } else {
+ CommandLine.getInstance().appendSwitch(CommandLine.USE_MOBILE_UA);
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698