OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/app/android/chrome_main_delegate_android.h" | 5 #include "chrome/app/android/chrome_main_delegate_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_registrar.h" |
8 #include "base/command_line.h" | 9 #include "base/command_line.h" |
9 #include "base/logging.h" | 10 #include "base/logging.h" |
10 #include "chrome/browser/android/chrome_jni_registrar.h" | 11 #include "chrome/browser/android/chrome_jni_registrar.h" |
11 #include "chrome/browser/android/chrome_startup_flags.h" | 12 #include "chrome/browser/android/chrome_startup_flags.h" |
| 13 #include "chrome/browser/android/tab_base_android_impl.h" |
12 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
13 #include "content/public/browser/browser_main_runner.h" | 15 #include "content/public/browser/browser_main_runner.h" |
14 | 16 |
| 17 static base::android::RegistrationMethod kRegistrationMethods[] = { |
| 18 { "TabBaseAndroidImpl", TabBaseAndroidImpl::RegisterTabBaseAndroidImpl }, |
| 19 }; |
| 20 |
15 // ChromeMainDelegateAndroid is created when the library is loaded. It is always | 21 // ChromeMainDelegateAndroid is created when the library is loaded. It is always |
16 // done in the process's main Java thread. But for non browser process, e.g. | 22 // done in the process's main Java thread. But for non browser process, e.g. |
17 // renderer process, it is not the native Chrome's main thread. | 23 // renderer process, it is not the native Chrome's main thread. |
18 ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() { | 24 ChromeMainDelegateAndroid::ChromeMainDelegateAndroid() { |
19 } | 25 } |
20 | 26 |
21 ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() { | 27 ChromeMainDelegateAndroid::~ChromeMainDelegateAndroid() { |
22 } | 28 } |
23 | 29 |
24 void ChromeMainDelegateAndroid::SandboxInitialized( | 30 void ChromeMainDelegateAndroid::SandboxInitialized( |
(...skipping 19 matching lines...) Expand all Loading... |
44 | 50 |
45 return ChromeMainDelegate::RunProcess(process_type, main_function_params); | 51 return ChromeMainDelegate::RunProcess(process_type, main_function_params); |
46 } | 52 } |
47 | 53 |
48 bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) { | 54 bool ChromeMainDelegateAndroid::BasicStartupComplete(int* exit_code) { |
49 SetChromeSpecificCommandLineFlags(); | 55 SetChromeSpecificCommandLineFlags(); |
50 return ChromeMainDelegate::BasicStartupComplete(exit_code); | 56 return ChromeMainDelegate::BasicStartupComplete(exit_code); |
51 } | 57 } |
52 | 58 |
53 bool ChromeMainDelegateAndroid::RegisterApplicationNativeMethods(JNIEnv* env) { | 59 bool ChromeMainDelegateAndroid::RegisterApplicationNativeMethods(JNIEnv* env) { |
54 return chrome::android::RegisterJni(env); | 60 if (!chrome::android::RegisterJni(env)) |
| 61 return false; |
| 62 |
| 63 return base::android::RegisterNativeMethods(env, |
| 64 kRegistrationMethods, |
| 65 arraysize(kRegistrationMethods)); |
55 } | 66 } |
OLD | NEW |