| 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/browser/android/chrome_jni_registrar.h" | 5 #include "chrome/browser/android/chrome_jni_registrar.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 "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "chrome/browser/android/accessibility_util.h" | 10 #include "chrome/browser/android/accessibility_util.h" |
| 11 #include "chrome/browser/android/banners/app_banner_manager.h" | 11 #include "chrome/browser/android/banners/app_banner_manager.h" |
| 12 #include "chrome/browser/android/bookmarks/bookmarks_bridge.h" | 12 #include "chrome/browser/android/bookmarks/bookmarks_bridge.h" |
| 13 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" | 13 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" |
| 14 #include "chrome/browser/android/chromium_application.h" | 14 #include "chrome/browser/android/chromium_application.h" |
| 15 #include "chrome/browser/android/content_view_util.h" | |
| 16 #include "chrome/browser/android/dev_tools_server.h" | 15 #include "chrome/browser/android/dev_tools_server.h" |
| 17 #include "chrome/browser/android/dom_distiller/feedback_reporter_android.h" | 16 #include "chrome/browser/android/dom_distiller/feedback_reporter_android.h" |
| 18 #include "chrome/browser/android/favicon_helper.h" | 17 #include "chrome/browser/android/favicon_helper.h" |
| 19 #include "chrome/browser/android/field_trial_helper.h" | |
| 20 #include "chrome/browser/android/foreign_session_helper.h" | 18 #include "chrome/browser/android/foreign_session_helper.h" |
| 21 #include "chrome/browser/android/intent_helper.h" | 19 #include "chrome/browser/android/intent_helper.h" |
| 22 #include "chrome/browser/android/most_visited_sites.h" | 20 #include "chrome/browser/android/most_visited_sites.h" |
| 23 #include "chrome/browser/android/new_tab_page_prefs.h" | 21 #include "chrome/browser/android/new_tab_page_prefs.h" |
| 24 #include "chrome/browser/android/omnibox/omnibox_prerender.h" | 22 #include "chrome/browser/android/omnibox/omnibox_prerender.h" |
| 25 #include "chrome/browser/android/password_authentication_manager.h" | 23 #include "chrome/browser/android/password_authentication_manager.h" |
| 26 #include "chrome/browser/android/password_ui_view_android.h" | 24 #include "chrome/browser/android/password_ui_view_android.h" |
| 27 #include "chrome/browser/android/profiles/profile_downloader_android.h" | 25 #include "chrome/browser/android/profiles/profile_downloader_android.h" |
| 28 #include "chrome/browser/android/provider/chrome_browser_provider.h" | 26 #include "chrome/browser/android/provider/chrome_browser_provider.h" |
| 29 #include "chrome/browser/android/recently_closed_tabs_bridge.h" | 27 #include "chrome/browser/android/recently_closed_tabs_bridge.h" |
| 30 #include "chrome/browser/android/shortcut_helper.h" | 28 #include "chrome/browser/android/shortcut_helper.h" |
| 31 #include "chrome/browser/android/signin/account_management_screen_helper.h" | 29 #include "chrome/browser/android/signin/account_management_screen_helper.h" |
| 32 #include "chrome/browser/android/signin/signin_manager_android.h" | 30 #include "chrome/browser/android/signin/signin_manager_android.h" |
| 33 #include "chrome/browser/android/tab_android.h" | 31 #include "chrome/browser/android/tab_android.h" |
| 34 #include "chrome/browser/android/uma_bridge.h" | |
| 35 #include "chrome/browser/android/uma_utils.h" | 32 #include "chrome/browser/android/uma_utils.h" |
| 36 #include "chrome/browser/android/url_utilities.h" | |
| 37 #include "chrome/browser/android/voice_search_tab_helper.h" | |
| 38 #include "chrome/browser/autofill/android/personal_data_manager_android.h" | 33 #include "chrome/browser/autofill/android/personal_data_manager_android.h" |
| 39 #include "chrome/browser/history/android/sqlite_cursor.h" | 34 #include "chrome/browser/history/android/sqlite_cursor.h" |
| 40 #include "chrome/browser/invalidation/invalidation_controller_android.h" | 35 #include "chrome/browser/invalidation/invalidation_controller_android.h" |
| 41 #include "chrome/browser/lifetime/application_lifetime_android.h" | 36 #include "chrome/browser/lifetime/application_lifetime_android.h" |
| 42 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" | 37 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" |
| 43 #include "chrome/browser/prerender/external_prerender_handler_android.h" | 38 #include "chrome/browser/prerender/external_prerender_handler_android.h" |
| 44 #include "chrome/browser/profiles/profile_android.h" | 39 #include "chrome/browser/profiles/profile_android.h" |
| 45 #include "chrome/browser/search_engines/template_url_service_android.h" | 40 #include "chrome/browser/search_engines/template_url_service_android.h" |
| 46 #include "chrome/browser/signin/android_profile_oauth2_token_service.h" | 41 #include "chrome/browser/signin/android_profile_oauth2_token_service.h" |
| 47 #include "chrome/browser/speech/tts_android.h" | 42 #include "chrome/browser/speech/tts_android.h" |
| 48 #include "chrome/browser/sync/profile_sync_service_android.h" | 43 #include "chrome/browser/sync/profile_sync_service_android.h" |
| 49 #include "chrome/browser/ui/android/autofill/autofill_dialog_controller_android.
h" | 44 #include "chrome/browser/ui/android/autofill/autofill_dialog_controller_android.
h" |
| 50 #include "chrome/browser/ui/android/autofill/autofill_dialog_result.h" | 45 #include "chrome/browser/ui/android/autofill/autofill_dialog_result.h" |
| 51 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" | 46 #include "chrome/browser/ui/android/autofill/autofill_logger_android.h" |
| 52 #include "chrome/browser/ui/android/autofill/autofill_popup_view_android.h" | 47 #include "chrome/browser/ui/android/autofill/autofill_popup_view_android.h" |
| 53 #include "chrome/browser/ui/android/chrome_http_auth_handler.h" | 48 #include "chrome/browser/ui/android/chrome_http_auth_handler.h" |
| 54 #include "chrome/browser/ui/android/context_menu_helper.h" | 49 #include "chrome/browser/ui/android/context_menu_helper.h" |
| 55 #include "chrome/browser/ui/android/infobars/auto_login_infobar_delegate_android
.h" | 50 #include "chrome/browser/ui/android/infobars/auto_login_infobar_delegate_android
.h" |
| 56 #include "chrome/browser/ui/android/infobars/confirm_infobar.h" | 51 #include "chrome/browser/ui/android/infobars/confirm_infobar.h" |
| 57 #include "chrome/browser/ui/android/infobars/infobar_android.h" | 52 #include "chrome/browser/ui/android/infobars/infobar_android.h" |
| 58 #include "chrome/browser/ui/android/infobars/infobar_container_android.h" | 53 #include "chrome/browser/ui/android/infobars/infobar_container_android.h" |
| 59 #include "chrome/browser/ui/android/infobars/save_password_infobar.h" | 54 #include "chrome/browser/ui/android/infobars/save_password_infobar.h" |
| 60 #include "chrome/browser/ui/android/infobars/translate_infobar.h" | 55 #include "chrome/browser/ui/android/infobars/translate_infobar.h" |
| 61 #include "chrome/browser/ui/android/javascript_app_modal_dialog_android.h" | 56 #include "chrome/browser/ui/android/javascript_app_modal_dialog_android.h" |
| 62 #include "chrome/browser/ui/android/navigation_popup.h" | 57 #include "chrome/browser/ui/android/navigation_popup.h" |
| 63 #include "chrome/browser/ui/android/ssl_client_certificate_request.h" | 58 #include "chrome/browser/ui/android/ssl_client_certificate_request.h" |
| 64 #include "chrome/browser/ui/android/toolbar/toolbar_model_android.h" | 59 #include "chrome/browser/ui/android/toolbar/toolbar_model_android.h" |
| 65 #include "chrome/browser/ui/android/website_settings_popup_android.h" | 60 #include "chrome/browser/ui/android/website_settings_popup_android.h" |
| 66 #include "components/autofill/core/browser/android/component_jni_registrar.h" | 61 #include "components/autofill/core/browser/android/component_jni_registrar.h" |
| 67 #include "components/dom_distiller/android/component_jni_registrar.h" | |
| 68 #include "components/navigation_interception/component_jni_registrar.h" | 62 #include "components/navigation_interception/component_jni_registrar.h" |
| 69 #include "components/web_contents_delegate_android/component_jni_registrar.h" | 63 #include "components/web_contents_delegate_android/component_jni_registrar.h" |
| 70 | 64 |
| 71 #if defined(ENABLE_PRINTING) && !defined(ENABLE_FULL_PRINTING) | 65 #if defined(ENABLE_PRINTING) && !defined(ENABLE_FULL_PRINTING) |
| 72 #include "printing/printing_context_android.h" | 66 #include "printing/printing_context_android.h" |
| 73 #endif | 67 #endif |
| 74 | 68 |
| 75 bool RegisterCertificateViewer(JNIEnv* env); | |
| 76 | |
| 77 namespace chrome { | 69 namespace chrome { |
| 78 namespace android { | 70 namespace android { |
| 79 | 71 |
| 80 static base::android::RegistrationMethod kChromeRegisteredMethods[] = { | 72 static const base::android::RegistrationMethod kChromeRegisteredMethods[] = { |
| 81 // Register JNI for components we depend on. | 73 // Register JNI for components we depend on. |
| 82 { "DomDistiller", dom_distiller::android::RegisterDomDistiller }, | |
| 83 { "NavigationInterception", | 74 { "NavigationInterception", |
| 84 navigation_interception::RegisterNavigationInterceptionJni }, | 75 navigation_interception::RegisterNavigationInterceptionJni }, |
| 85 { "WebContentsDelegateAndroid", | 76 { "WebContentsDelegateAndroid", |
| 86 web_contents_delegate_android::RegisterWebContentsDelegateAndroidJni }, | 77 web_contents_delegate_android::RegisterWebContentsDelegateAndroidJni }, |
| 87 { "RegisterAuxiliaryProfileLoader", autofill::RegisterAutofillAndroidJni }, | 78 { "RegisterAuxiliaryProfileLoader", autofill::RegisterAutofillAndroidJni }, |
| 88 // Register JNI for chrome classes. | 79 // Register JNI for chrome classes. |
| 89 { "AccessibilityUtils", AccessibilityUtil::Register }, | 80 { "AccessibilityUtils", AccessibilityUtil::Register }, |
| 90 { "AccountManagementScreenHelper", AccountManagementScreenHelper::Register }, | 81 { "AccountManagementScreenHelper", AccountManagementScreenHelper::Register }, |
| 91 { "AndroidProfileOAuth2TokenService", | 82 { "AndroidProfileOAuth2TokenService", |
| 92 AndroidProfileOAuth2TokenService::Register }, | 83 AndroidProfileOAuth2TokenService::Register }, |
| 93 { "AppBannerManager", banners::RegisterAppBannerManager }, | 84 { "AppBannerManager", banners::RegisterAppBannerManager }, |
| 94 { "ApplicationLifetime", RegisterApplicationLifetimeAndroid }, | 85 { "ApplicationLifetime", RegisterApplicationLifetimeAndroid }, |
| 95 { "AutofillDialogControllerAndroid", | 86 { "AutofillDialogControllerAndroid", |
| 96 autofill::AutofillDialogControllerAndroid:: | 87 autofill::AutofillDialogControllerAndroid:: |
| 97 RegisterAutofillDialogControllerAndroid }, | 88 RegisterAutofillDialogControllerAndroid }, |
| 98 { "AutofillDialogResult", | 89 { "AutofillDialogResult", |
| 99 autofill::AutofillDialogResult::RegisterAutofillDialogResult }, | 90 autofill::AutofillDialogResult::RegisterAutofillDialogResult }, |
| 100 { "AutofillLoggerAndroid", | 91 { "AutofillLoggerAndroid", |
| 101 autofill::AutofillLoggerAndroid::Register }, | 92 autofill::AutofillLoggerAndroid::Register }, |
| 102 { "AutofillPopup", | 93 { "AutofillPopup", |
| 103 autofill::AutofillPopupViewAndroid::RegisterAutofillPopupViewAndroid }, | 94 autofill::AutofillPopupViewAndroid::RegisterAutofillPopupViewAndroid }, |
| 104 { "AutoLoginDelegate", AutoLoginInfoBarDelegateAndroid::Register }, | 95 { "AutoLoginDelegate", AutoLoginInfoBarDelegateAndroid::Register }, |
| 105 { "BookmarksBridge", BookmarksBridge::RegisterBookmarksBridge }, | 96 { "BookmarksBridge", BookmarksBridge::RegisterBookmarksBridge }, |
| 106 { "CertificateViewer", RegisterCertificateViewer }, | |
| 107 { "ChromeBrowserProvider", | 97 { "ChromeBrowserProvider", |
| 108 ChromeBrowserProvider::RegisterChromeBrowserProvider }, | 98 ChromeBrowserProvider::RegisterChromeBrowserProvider }, |
| 109 { "ChromeHttpAuthHandler", | 99 { "ChromeHttpAuthHandler", |
| 110 ChromeHttpAuthHandler::RegisterChromeHttpAuthHandler }, | 100 ChromeHttpAuthHandler::RegisterChromeHttpAuthHandler }, |
| 111 { "ChromeWebContentsDelegateAndroid", | 101 { "ChromeWebContentsDelegateAndroid", |
| 112 RegisterChromeWebContentsDelegateAndroid }, | 102 RegisterChromeWebContentsDelegateAndroid }, |
| 113 { "ChromiumApplication", | 103 { "ChromiumApplication", |
| 114 ChromiumApplication::RegisterBindings }, | 104 ChromiumApplication::RegisterBindings }, |
| 115 { "ConfirmInfoBarDelegate", RegisterConfirmInfoBarDelegate }, | 105 { "ConfirmInfoBarDelegate", RegisterConfirmInfoBarDelegate }, |
| 116 { "ContentViewUtil", RegisterContentViewUtil }, | |
| 117 { "ContextMenuHelper", RegisterContextMenuHelper }, | 106 { "ContextMenuHelper", RegisterContextMenuHelper }, |
| 118 { "DataReductionProxySettings", DataReductionProxySettingsAndroid::Register }, | 107 { "DataReductionProxySettings", DataReductionProxySettingsAndroid::Register }, |
| 119 { "DevToolsServer", RegisterDevToolsServer }, | |
| 120 { "InvalidationController", invalidation::RegisterInvalidationController }, | 108 { "InvalidationController", invalidation::RegisterInvalidationController }, |
| 121 { "ExternalPrerenderRequestHandler", | |
| 122 prerender::ExternalPrerenderHandlerAndroid:: | |
| 123 RegisterExternalPrerenderHandlerAndroid }, | |
| 124 { "FaviconHelper", FaviconHelper::RegisterFaviconHelper }, | 109 { "FaviconHelper", FaviconHelper::RegisterFaviconHelper }, |
| 125 { "FeedbackReporter", dom_distiller::android::RegisterFeedbackReporter }, | 110 { "FeedbackReporter", dom_distiller::android::RegisterFeedbackReporter }, |
| 126 { "FieldTrialHelper", RegisterFieldTrialHelper }, | |
| 127 { "ForeignSessionHelper", | 111 { "ForeignSessionHelper", |
| 128 ForeignSessionHelper::RegisterForeignSessionHelper }, | 112 ForeignSessionHelper::RegisterForeignSessionHelper }, |
| 129 { "InfoBarContainer", RegisterInfoBarContainer }, | 113 { "InfoBarContainer", RegisterInfoBarContainer }, |
| 130 { "ShortcutHelper", ShortcutHelper::RegisterShortcutHelper }, | 114 { "ShortcutHelper", ShortcutHelper::RegisterShortcutHelper }, |
| 131 { "IntentHelper", RegisterIntentHelper }, | 115 { "IntentHelper", RegisterIntentHelper }, |
| 132 { "JavascriptAppModalDialog", | 116 { "JavascriptAppModalDialog", |
| 133 JavascriptAppModalDialogAndroid::RegisterJavascriptAppModalDialog }, | 117 JavascriptAppModalDialogAndroid::RegisterJavascriptAppModalDialog }, |
| 134 { "MostVisitedSites", MostVisitedSites::Register }, | 118 { "MostVisitedSites", MostVisitedSites::Register }, |
| 135 { "NativeInfoBar", RegisterNativeInfoBar }, | 119 { "NativeInfoBar", RegisterNativeInfoBar }, |
| 136 { "NavigationPopup", NavigationPopup::RegisterNavigationPopup }, | 120 { "NavigationPopup", NavigationPopup::RegisterNavigationPopup }, |
| 137 { "NewTabPagePrefs", | |
| 138 NewTabPagePrefs::RegisterNewTabPagePrefs }, | |
| 139 { "OmniboxPrerender", RegisterOmniboxPrerender }, | |
| 140 { "PasswordAuthenticationManager", | 121 { "PasswordAuthenticationManager", |
| 141 PasswordAuthenticationManager::RegisterPasswordAuthenticationManager }, | 122 PasswordAuthenticationManager::RegisterPasswordAuthenticationManager }, |
| 142 { "PasswordUIViewAndroid", | 123 { "PasswordUIViewAndroid", |
| 143 PasswordUIViewAndroid::RegisterPasswordUIViewAndroid }, | 124 PasswordUIViewAndroid::RegisterPasswordUIViewAndroid }, |
| 144 { "PersonalDataManagerAndroid", | 125 { "PersonalDataManagerAndroid", |
| 145 autofill::PersonalDataManagerAndroid::Register }, | 126 autofill::PersonalDataManagerAndroid::Register }, |
| 146 { "ProfileAndroid", ProfileAndroid::RegisterProfileAndroid }, | 127 { "ProfileAndroid", ProfileAndroid::RegisterProfileAndroid }, |
| 147 { "ProfileDownloaderAndroid", ProfileDownloaderAndroid::Register }, | 128 { "ProfileDownloaderAndroid", ProfileDownloaderAndroid::Register }, |
| 148 { "ProfileSyncService", ProfileSyncServiceAndroid::Register }, | 129 { "ProfileSyncService", ProfileSyncServiceAndroid::Register }, |
| 149 { "RecentlyClosedBridge", RecentlyClosedTabsBridge::Register }, | 130 { "RecentlyClosedBridge", RecentlyClosedTabsBridge::Register }, |
| 150 { "SavePasswordInfoBar", RegisterSavePasswordInfoBar }, | 131 { "SavePasswordInfoBar", RegisterSavePasswordInfoBar }, |
| 151 { "SigninManager", SigninManagerAndroid::Register }, | 132 { "SigninManager", SigninManagerAndroid::Register }, |
| 152 { "SqliteCursor", SQLiteCursor::RegisterSqliteCursor }, | 133 { "SqliteCursor", SQLiteCursor::RegisterSqliteCursor }, |
| 153 { "SSLClientCertificateRequest", RegisterSSLClientCertificateRequestAndroid }, | 134 { "SSLClientCertificateRequest", RegisterSSLClientCertificateRequestAndroid }, |
| 154 { "StartupMetricUtils", RegisterStartupMetricUtils }, | 135 { "StartupMetricUtils", RegisterStartupMetricUtils }, |
| 155 { "TabAndroid", TabAndroid::RegisterTabAndroid }, | 136 { "TabAndroid", TabAndroid::RegisterTabAndroid }, |
| 156 { "TemplateUrlServiceAndroid", TemplateUrlServiceAndroid::Register }, | 137 { "TemplateUrlServiceAndroid", TemplateUrlServiceAndroid::Register }, |
| 157 { "ToolbarModelAndroid", ToolbarModelAndroid::RegisterToolbarModelAndroid }, | 138 { "ToolbarModelAndroid", ToolbarModelAndroid::RegisterToolbarModelAndroid }, |
| 158 { "TranslateInfoBarDelegate", RegisterTranslateInfoBarDelegate }, | 139 { "TranslateInfoBarDelegate", RegisterTranslateInfoBarDelegate }, |
| 159 { "TtsPlatformImpl", TtsPlatformImplAndroid::Register }, | 140 { "TtsPlatformImpl", TtsPlatformImplAndroid::Register }, |
| 160 { "UmaBridge", RegisterUmaBridge }, | |
| 161 { "UrlUtilities", RegisterUrlUtilities }, | |
| 162 { "VoiceSearchTabHelper", RegisterVoiceSearchTabHelper }, | |
| 163 { "WebsiteSettingsPopupAndroid", | 141 { "WebsiteSettingsPopupAndroid", |
| 164 WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid }, | 142 WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid }, |
| 165 #if defined(ENABLE_PRINTING) && !defined(ENABLE_FULL_PRINTING) | 143 #if defined(ENABLE_PRINTING) && !defined(ENABLE_FULL_PRINTING) |
| 166 { "PrintingContext", | 144 { "PrintingContext", |
| 167 printing::PrintingContextAndroid::RegisterPrintingContext}, | 145 printing::PrintingContextAndroid::RegisterPrintingContext}, |
| 168 #endif | 146 #endif |
| 169 }; | 147 }; |
| 170 | 148 |
| 171 bool RegisterJni(JNIEnv* env) { | 149 bool RegisterJni(JNIEnv* env) { |
| 172 TRACE_EVENT0("startup", "chrome_android::RegisterJni"); | 150 TRACE_EVENT0("startup", "chrome_android::RegisterJni"); |
| 173 return RegisterNativeMethods(env, kChromeRegisteredMethods, | 151 return RegisterNativeMethods(env, kChromeRegisteredMethods, |
| 174 arraysize(kChromeRegisteredMethods)); | 152 arraysize(kChromeRegisteredMethods)); |
| 175 } | 153 } |
| 176 | 154 |
| 177 } // namespace android | 155 } // namespace android |
| 178 } // namespace chrome | 156 } // namespace chrome |
| OLD | NEW |