diff options
author | yusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 20:06:16 +0000 |
---|---|---|
committer | yusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-15 20:06:16 +0000 |
commit | a093624b0f8a144c2b140431550ebe9d840915ed (patch) | |
tree | 62bd5ab74ca634433916b4dee20545b593fca60d /chrome/android | |
parent | 2f693fe05f27bf656d94311cc9c1980ad0edf65a (diff) | |
download | chromium_src-a093624b0f8a144c2b140431550ebe9d840915ed.zip chromium_src-a093624b0f8a144c2b140431550ebe9d840915ed.tar.gz chromium_src-a093624b0f8a144c2b140431550ebe9d840915ed.tar.bz2 |
Upstream BrowserChildProcessHostImpl
This is also needed to make it possible for content_shell and test_shell
to use mobile as user agent. Some methods and files had to be moved out of chrome
to be able to use them in content_shell
BUG=152807,154122
Review URL: https://chromiumcodereview.appspot.com/11066087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/android')
-rw-r--r-- | chrome/android/java/src/org/chromium/chrome/browser/DeviceUtils.java | 28 | ||||
-rw-r--r-- | chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java | 3 |
2 files changed, 3 insertions, 28 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/DeviceUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/DeviceUtils.java deleted file mode 100644 index bfba7cc..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/DeviceUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 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.chrome.browser; - -import android.content.Context; - -/** - * 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; - - /** - * @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) { - int minimumScreenWidthDp = context.getResources().getConfiguration().smallestScreenWidthDp; - return minimumScreenWidthDp >= MINIMUM_TABLET_WIDTH_DP; - } - -} diff --git a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java index 40c2e37..7184428 100644 --- a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java +++ b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellActivity.java @@ -15,6 +15,7 @@ import org.chromium.chrome.browser.TabBase; import org.chromium.content.app.AppResource; import org.chromium.content.app.LibraryLoader; import org.chromium.content.browser.ContentView; +import org.chromium.content.browser.DeviceUtils; import org.chromium.content.common.CommandLine; import org.chromium.ui.gfx.ActivityNativeWindow; @@ -36,6 +37,8 @@ public class ChromiumTestShellActivity extends Activity { if (!CommandLine.isInitialized()) CommandLine.initFromFile(COMMAND_LINE_FILE); waitForDebuggerIfNeeded(); + DeviceUtils.addDeviceSpecificUserAgentSwitch(this); + initializeContentViewResources(); ContentView.initChromiumBrowserProcess(this, ContentView.MAX_RENDERERS_AUTOMATIC); |