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 /content/shell | |
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 'content/shell')
-rw-r--r-- | content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java | 3 | ||||
-rw-r--r-- | content/shell/shell_content_client.cc | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java b/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java index 64f0347..96ff75d 100644 --- a/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java +++ b/content/shell/android/java/src/org/chromium/content_shell/ContentShellActivity.java @@ -14,6 +14,7 @@ import android.view.KeyEvent; 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; @@ -46,6 +47,8 @@ public class ContentShellActivity extends Activity { } waitForDebuggerIfNeeded(); + DeviceUtils.addDeviceSpecificUserAgentSwitch(this); + LibraryLoader.loadAndInitSync(); initializeContentViewResources(); diff --git a/content/shell/shell_content_client.cc b/content/shell/shell_content_client.cc index 6c770d0..eb951d4 100644 --- a/content/shell/shell_content_client.cc +++ b/content/shell/shell_content_client.cc @@ -4,7 +4,9 @@ #include "content/shell/shell_content_client.h" +#include "base/command_line.h" #include "base/string_piece.h" +#include "content/public/common/content_switches.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "webkit/user_agent/user_agent_util.h" @@ -18,7 +20,11 @@ std::string ShellContentClient::GetUserAgent() const { // The "19" is so that sites that sniff for version think that this is // something reasonably current; the "77.34.5" is a hint that this isn't a // standard Chrome. - return webkit_glue::BuildUserAgentFromProduct("Chrome/19.77.34.5"); + std::string product = "Chrome/19.77.34.5"; + CommandLine* command_line = CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(switches::kUseMobileUserAgent)) + product += " Mobile"; + return webkit_glue::BuildUserAgentFromProduct(product); } string16 ShellContentClient::GetLocalizedString(int message_id) const { |