| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.pm.PackageManager; | 8 import android.content.pm.PackageManager; |
| 9 | 9 |
| 10 import org.chromium.content.common.CommandLine; | 10 import org.chromium.base.CommandLine; |
| 11 import org.chromium.content.common.ContentSwitches; |
| 11 | 12 |
| 12 /** | 13 /** |
| 13 * A utility class that has helper methods for device configuration. | 14 * A utility class that has helper methods for device configuration. |
| 14 */ | 15 */ |
| 15 public class DeviceUtils { | 16 public class DeviceUtils { |
| 16 | 17 |
| 17 /** | 18 /** |
| 18 * The minimum width that would classify the device as a tablet. | 19 * The minimum width that would classify the device as a tablet. |
| 19 */ | 20 */ |
| 20 private static final int MINIMUM_TABLET_WIDTH_DP = 600; | 21 private static final int MINIMUM_TABLET_WIDTH_DP = 600; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 59 } |
| 59 return sIsTv; | 60 return sIsTv; |
| 60 } | 61 } |
| 61 | 62 |
| 62 /** | 63 /** |
| 63 * Appends the switch specifying which user agent should be used for this de
vice. | 64 * Appends the switch specifying which user agent should be used for this de
vice. |
| 64 * @param context The context for the caller activity. | 65 * @param context The context for the caller activity. |
| 65 */ | 66 */ |
| 66 public static void addDeviceSpecificUserAgentSwitch(Context context) { | 67 public static void addDeviceSpecificUserAgentSwitch(Context context) { |
| 67 if (isTablet(context)) { | 68 if (isTablet(context)) { |
| 68 CommandLine.getInstance().appendSwitch(CommandLine.TABLET_UI); | 69 CommandLine.getInstance().appendSwitch(ContentSwitches.TABLET_UI); |
| 69 } else { | 70 } else { |
| 70 CommandLine.getInstance().appendSwitch(CommandLine.USE_MOBILE_UA); | 71 CommandLine.getInstance().appendSwitch(ContentSwitches.USE_MOBILE_UA
); |
| 71 } | 72 } |
| 72 } | 73 } |
| 73 } | 74 } |
| OLD | NEW |