OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/common/android/process_main.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" |
| 11 #include "base/android/jni_android.h" |
| 12 #include "base/android/scoped_java_ref.h" |
| 13 #if !defined(ANDROID_UPSTREAM_BRINGUP) |
| 14 #include "content/common/android/user_agent.h" |
| 15 #endif |
| 16 #include "content/public/common/content_switches.h" |
| 17 #if !defined(ANDROID_UPSTREAM_BRINGUP) |
| 18 #include "webkit/glue/user_agent.h" |
| 19 #endif |
| 20 |
| 21 namespace content { |
| 22 |
| 23 ContentMainDelegate* g_content_main_delegate = NULL; |
| 24 |
| 25 bool InitProcess(JNIEnv* env, jobject context) { |
| 26 if (!g_content_main_delegate) { |
| 27 LOG(ERROR) << "TODO: Need to add the default delegate."; |
| 28 return false; |
| 29 } |
| 30 base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context); |
| 31 base::android::InitApplicationContext(scoped_context); |
| 32 #if !defined(ANDROID_UPSTREAM_BRINGUP) |
| 33 webkit_glue::InitUserAgent(GetUserAgentOSInfo()); |
| 34 #endif |
| 35 return true; |
| 36 } |
| 37 |
| 38 } // namespace content |
OLD | NEW |