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

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

Issue 141533006: [Android] Move the java content/ package to content_public/ to start the split. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small fixes and findbugs line update Created 6 years, 11 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/content/public/android/java/src/org/chromium/content/browser/DeviceUtils.java b/content/public/android/java/src/org/chromium/content/browser/DeviceUtils.java
deleted file mode 100644
index f472dc94c19b6061cf81e54c965793c3040186a9..0000000000000000000000000000000000000000
--- a/content/public/android/java/src/org/chromium/content/browser/DeviceUtils.java
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.content.browser;
-
-import android.content.Context;
-
-import org.chromium.base.CommandLine;
-import org.chromium.content.common.ContentSwitches;
-
-/**
- * A utility class that has helper methods for device configuration.
- */
-public class DeviceUtils {
-
- /**
- * The minimum width that would classify the device as a tablet.
- */
- private static final int MINIMUM_TABLET_WIDTH_DP = 600;
-
- private static Boolean sIsTablet = null;
-
- /**
- * @param context Android's context
- * @return Whether the app is should treat the device as a tablet for layout.
- */
- public static boolean isTablet(Context context) {
- if (sIsTablet == null) {
- int minimumScreenWidthDp = context.getResources().getConfiguration().
- smallestScreenWidthDp;
- sIsTablet = minimumScreenWidthDp >= MINIMUM_TABLET_WIDTH_DP;
- }
- return sIsTablet;
- }
-
- /**
- * 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) {
- if (isTablet(context)) {
- CommandLine.getInstance().appendSwitch(ContentSwitches.TABLET_UI);
- } else {
- CommandLine.getInstance().appendSwitch(ContentSwitches.USE_MOBILE_UA);
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698