Index: content/common/android/process_main.cc |
diff --git a/content/common/android/process_main.cc b/content/common/android/process_main.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..be327064c437ff019c9aafd129d0b3d0eeddf88a |
--- /dev/null |
+++ b/content/common/android/process_main.cc |
@@ -0,0 +1,32 @@ |
+// 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/common/android/process_main.h" |
+ |
+#include <string> |
+ |
+#include "base/command_line.h" |
+#include "base/logging.h" |
+#include "base/android/jni_android.h" |
+#include "base/android/scoped_java_ref.h" |
+#if !defined(ANDROID_UPSTREAM_BRINGUP) |
+#include "content/common/android/user_agent.h" |
+#endif |
+#include "content/public/common/content_switches.h" |
+#include "webkit/glue/user_agent.h" |
+ |
+content::ContentMainDelegate* g_content_main_delegate = NULL; |
+ |
+bool InitProcess(JNIEnv* env, jobject context) { |
+ if (!g_content_main_delegate) { |
+ LOG(ERROR) << "TODO: Need to add the default delegate."; |
+ return false; |
+ } |
+ base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context); |
+ base::android::InitApplicationContext(scoped_context); |
+#if !defined(ANDROID_UPSTREAM_BRINGUP) |
+ webkit_glue::InitUserAgent(GetUserAgentOSInfo()); |
+#endif |
+ return true; |
+} |