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); |
+ } |
+ } |
} |