OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/android/sync_shell/chrome_main_delegate_chrome_sync_shell_andro
id.h" | 5 #include "chrome/android/sync_shell/chrome_main_delegate_chrome_sync_shell_andro
id.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/android/jni_registrar.h" |
9 #include "sync/test/fake_server/android/fake_server_helper_android.h" | 9 #include "sync/test/fake_server/android/fake_server_helper_android.h" |
10 | 10 |
11 ChromeMainDelegateAndroid* ChromeMainDelegateAndroid::Create() { | 11 ChromeMainDelegateAndroid* ChromeMainDelegateAndroid::Create() { |
12 return new ChromeMainDelegateChromeSyncShellAndroid(); | 12 return new ChromeMainDelegateChromeSyncShellAndroid(); |
13 } | 13 } |
14 | 14 |
15 ChromeMainDelegateChromeSyncShellAndroid:: | 15 ChromeMainDelegateChromeSyncShellAndroid:: |
16 ChromeMainDelegateChromeSyncShellAndroid() { | 16 ChromeMainDelegateChromeSyncShellAndroid() { |
17 } | 17 } |
18 | 18 |
19 ChromeMainDelegateChromeSyncShellAndroid:: | 19 ChromeMainDelegateChromeSyncShellAndroid:: |
20 ~ChromeMainDelegateChromeSyncShellAndroid() { | 20 ~ChromeMainDelegateChromeSyncShellAndroid() { |
21 } | 21 } |
22 | 22 |
23 bool | |
24 ChromeMainDelegateChromeSyncShellAndroid::RegisterApplicationNativeMethods( | |
25 JNIEnv* env) { | |
26 return ChromeMainDelegateAndroid::RegisterApplicationNativeMethods(env) && | |
27 FakeServerHelperAndroid::Register(env); | |
28 } | |
29 | |
30 bool ChromeMainDelegateChromeSyncShellAndroid::BasicStartupComplete( | 23 bool ChromeMainDelegateChromeSyncShellAndroid::BasicStartupComplete( |
31 int* exit_code) { | 24 int* exit_code) { |
32 return ChromeMainDelegateAndroid::BasicStartupComplete(exit_code); | 25 return ChromeMainDelegateAndroid::BasicStartupComplete(exit_code); |
33 } | 26 } |
34 | 27 |
| 28 int ChromeMainDelegateChromeSyncShellAndroid::RunProcess( |
| 29 const std::string& process_type, |
| 30 const content::MainFunctionParams& main_function_params) { |
| 31 if (process_type.empty()) { |
| 32 // This JNI registration can not be moved to JNI_OnLoad because |
| 33 // FakeServerHelper seems not known by class loader when shared library |
| 34 // is loaded. |
| 35 FakeServerHelperAndroid::Register(base::android::AttachCurrentThread()); |
| 36 } |
| 37 return ChromeMainDelegateAndroid::RunProcess(process_type, |
| 38 main_function_params); |
| 39 } |
OLD | NEW |