summaryrefslogtreecommitdiffstats
path: root/content/app/android
diff options
context:
space:
mode:
authordfalcantara@chromium.org <dfalcantara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-21 23:55:52 +0000
committerdfalcantara@chromium.org <dfalcantara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-21 23:55:52 +0000
commitabef4b33bc3d484621e28a70c141e6ca8ce7aa1e (patch)
treed495c173007c3ecb45efe288f072bd23d26537a1 /content/app/android
parentb7c8d6c560adc7cddfcf23ad73e3c4378ef65ea4 (diff)
downloadchromium_src-abef4b33bc3d484621e28a70c141e6ca8ce7aa1e.zip
chromium_src-abef4b33bc3d484621e28a70c141e6ca8ce7aa1e.tar.gz
chromium_src-abef4b33bc3d484621e28a70c141e6ca8ce7aa1e.tar.bz2
Move Android user agent generation to native code
Gets rid of a pathway that forced us to set the user agent from the Java side, replacing it with one that's entirely native. Functions have been added to base to allow accessing information about the device and Android build, while the user agent generation code was moved to the webkit_glue namespace. BUG=131312 Review URL: https://chromiumcodereview.appspot.com/10832235 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/app/android')
-rw-r--r--content/app/android/app_jni_registrar.cc2
-rw-r--r--content/app/android/content_main.cc3
-rw-r--r--content/app/android/user_agent.cc30
-rw-r--r--content/app/android/user_agent.h21
4 files changed, 0 insertions, 56 deletions
diff --git a/content/app/android/app_jni_registrar.cc b/content/app/android/app_jni_registrar.cc
index 699b618..ee0863a 100644
--- a/content/app/android/app_jni_registrar.cc
+++ b/content/app/android/app_jni_registrar.cc
@@ -8,14 +8,12 @@
#include "base/android/jni_registrar.h"
#include "content/app/android/content_main.h"
#include "content/app/android/sandboxed_process_service.h"
-#include "content/app/android/user_agent.h"
namespace {
base::android::RegistrationMethod kContentRegisteredMethods[] = {
{ "ContentMain", content::RegisterContentMain },
{ "SandboxedProcessService", content::RegisterSandboxedProcessService },
- { "UserAgent", content::RegisterUserAgent },
};
} // namespace
diff --git a/content/app/android/content_main.cc b/content/app/android/content_main.cc
index f373186..1371617 100644
--- a/content/app/android/content_main.cc
+++ b/content/app/android/content_main.cc
@@ -8,7 +8,6 @@
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/lazy_instance.h"
-#include "content/app/android/user_agent.h"
#include "content/public/app/content_main_delegate.h"
#include "content/public/app/content_main_runner.h"
#include "content/public/common/content_switches.h"
@@ -47,8 +46,6 @@ static jint Start(JNIEnv* env, jclass clazz) {
base::debug::WaitForDebugger(24*60*60, false);
}
- webkit_glue::SetUserAgentOSInfo(content::GetUserAgentOSInfo());
-
DCHECK(!g_content_runner.Get().get());
g_content_runner.Get().reset(ContentMainRunner::Create());
g_content_runner.Get()->Initialize(0, NULL,
diff --git a/content/app/android/user_agent.cc b/content/app/android/user_agent.cc
deleted file mode 100644
index 7a1c49b..0000000
--- a/content/app/android/user_agent.cc
+++ /dev/null
@@ -1,30 +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.
-
-#include "content/app/android/user_agent.h"
-
-#include "base/android/jni_android.h"
-#include "base/android/jni_string.h"
-#include "base/android/scoped_java_ref.h"
-#include "jni/UserAgent_jni.h"
-
-using base::android::AttachCurrentThread;
-using base::android::ScopedJavaLocalRef;
-using base::android::ConvertJavaStringToUTF8;
-using base::android::GetApplicationContext;
-
-namespace content {
-
-std::string GetUserAgentOSInfo() {
- JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jstring> os_info =
- Java_UserAgent_getUserAgentOSInfo(env);
- return ConvertJavaStringToUTF8(os_info);
-}
-
-bool RegisterUserAgent(JNIEnv* env) {
- return RegisterNativesImpl(env);
-}
-
-} // namespace content
diff --git a/content/app/android/user_agent.h b/content/app/android/user_agent.h
deleted file mode 100644
index 374c5fb..0000000
--- a/content/app/android/user_agent.h
+++ /dev/null
@@ -1,21 +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.
-
-#ifndef CONTENT_APP_ANDROID_USER_AGENT_H_
-#define CONTENT_APP_ANDROID_USER_AGENT_H_
-
-#include <jni.h>
-#include <string>
-
-namespace content {
-
-// Returns the OS information component required by user agent composition.
-std::string GetUserAgentOSInfo();
-
-// Register JNI method.
-bool RegisterUserAgent(JNIEnv* env);
-
-} // namespace content
-
-#endif // CONTENT_APP_ANDROID_USER_AGENT_H_