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/tab_android.h" | 5 #include "chrome/browser/android/tab_android.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
9 #include "chrome/browser/extensions/tab_helper.h" | 9 #include "chrome/browser/extensions/tab_helper.h" |
10 #include "chrome/browser/favicon/favicon_tab_helper.h" | 10 #include "chrome/browser/favicon/favicon_tab_helper.h" |
11 #include "chrome/browser/history/history_tab_helper.h" | 11 #include "chrome/browser/history/history_tab_helper.h" |
12 #include "chrome/browser/infobars/infobar_service.h" | 12 #include "chrome/browser/infobars/infobar_service.h" |
13 #include "chrome/browser/password_manager/password_manager.h" | 13 #include "chrome/browser/password_manager/password_manager.h" |
14 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" | 14 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
15 #include "chrome/browser/prerender/prerender_tab_helper.h" | 15 #include "chrome/browser/prerender/prerender_tab_helper.h" |
16 #include "chrome/browser/sessions/session_tab_helper.h" | 16 #include "chrome/browser/sessions/session_tab_helper.h" |
17 #include "chrome/browser/ssl/ssl_tab_helper.h" | 17 #include "chrome/browser/ssl/ssl_tab_helper.h" |
18 #include "chrome/browser/translate/translate_tab_helper.h" | 18 #include "chrome/browser/translate/translate_tab_helper.h" |
19 #include "chrome/browser/ui/alternate_error_tab_observer.h" | 19 #include "chrome/browser/ui/alternate_error_tab_observer.h" |
20 #include "chrome/browser/ui/android/window_android_helper.h" | 20 #include "chrome/browser/ui/android/window_android_helper.h" |
21 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" | 21 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" |
22 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 22 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
23 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 23 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
24 #include "chrome/browser/ui/browser_tab_contents.h" | 24 #include "chrome/browser/ui/browser_tab_contents.h" |
25 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 25 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
26 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" | 26 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
27 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 27 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
28 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" | 28 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" |
29 #include "components/autofill/browser/autofill_external_delegate.h" | 29 #include "components/autofill/content/browser/autofill_driver_impl.h" |
30 #include "components/autofill/browser/autofill_manager.h" | |
31 #include "content/public/browser/android/content_view_core.h" | 30 #include "content/public/browser/android/content_view_core.h" |
32 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
33 #include "extensions/browser/view_type_utils.h" | 32 #include "extensions/browser/view_type_utils.h" |
34 #include "jni/TabBase_jni.h" | 33 #include "jni/TabBase_jni.h" |
35 | 34 |
36 using content::WebContents; | 35 using content::WebContents; |
37 | 36 |
38 namespace { | 37 namespace { |
39 | 38 |
40 const char kTabHelpersInitializedUserDataKey[] = | 39 const char kTabHelpersInitializedUserDataKey[] = |
(...skipping 14 matching lines...) Expand all Loading... |
55 | 54 |
56 // Set the view type. | 55 // Set the view type. |
57 extensions::SetViewType(contents, extensions::VIEW_TYPE_TAB_CONTENTS); | 56 extensions::SetViewType(contents, extensions::VIEW_TYPE_TAB_CONTENTS); |
58 | 57 |
59 // SessionTabHelper comes first because it sets up the tab ID, and other | 58 // SessionTabHelper comes first because it sets up the tab ID, and other |
60 // helpers may rely on that. | 59 // helpers may rely on that. |
61 SessionTabHelper::CreateForWebContents(contents); | 60 SessionTabHelper::CreateForWebContents(contents); |
62 | 61 |
63 AlternateErrorPageTabObserver::CreateForWebContents(contents); | 62 AlternateErrorPageTabObserver::CreateForWebContents(contents); |
64 autofill::TabAutofillManagerDelegate::CreateForWebContents(contents); | 63 autofill::TabAutofillManagerDelegate::CreateForWebContents(contents); |
65 autofill::AutofillManager::CreateForWebContentsAndDelegate( | 64 autofill::AutofillDriverImpl::CreateForWebContentsAndDelegate( |
66 contents, | 65 contents, |
67 autofill::TabAutofillManagerDelegate::FromWebContents(contents), | 66 autofill::TabAutofillManagerDelegate::FromWebContents(contents), |
68 g_browser_process->GetApplicationLocale(), | 67 g_browser_process->GetApplicationLocale(), |
69 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); | 68 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER, |
70 autofill::AutofillExternalDelegate::CreateForWebContentsAndManager( | 69 true); |
71 contents, autofill::AutofillManager::FromWebContents(contents)); | |
72 autofill::AutofillManager::FromWebContents(contents)->SetExternalDelegate( | |
73 autofill::AutofillExternalDelegate::FromWebContents(contents)); | |
74 BlockedContentTabHelper::CreateForWebContents(contents); | 70 BlockedContentTabHelper::CreateForWebContents(contents); |
75 BookmarkTabHelper::CreateForWebContents(contents); | 71 BookmarkTabHelper::CreateForWebContents(contents); |
76 CoreTabHelper::CreateForWebContents(contents); | 72 CoreTabHelper::CreateForWebContents(contents); |
77 extensions::TabHelper::CreateForWebContents(contents); | 73 extensions::TabHelper::CreateForWebContents(contents); |
78 FaviconTabHelper::CreateForWebContents(contents); | 74 FaviconTabHelper::CreateForWebContents(contents); |
79 FindTabHelper::CreateForWebContents(contents); | 75 FindTabHelper::CreateForWebContents(contents); |
80 HistoryTabHelper::CreateForWebContents(contents); | 76 HistoryTabHelper::CreateForWebContents(contents); |
81 InfoBarService::CreateForWebContents(contents); | 77 InfoBarService::CreateForWebContents(contents); |
82 PasswordManagerDelegateImpl::CreateForWebContents(contents); | 78 PasswordManagerDelegateImpl::CreateForWebContents(contents); |
83 PasswordManager::CreateForWebContentsAndDelegate( | 79 PasswordManager::CreateForWebContentsAndDelegate( |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 ToolbarModel::SecurityLevel TabAndroid::GetSecurityLevel() { | 127 ToolbarModel::SecurityLevel TabAndroid::GetSecurityLevel() { |
132 return ToolbarModelImpl::GetSecurityLevelForWebContents(GetWebContents()); | 128 return ToolbarModelImpl::GetSecurityLevelForWebContents(GetWebContents()); |
133 } | 129 } |
134 | 130 |
135 void TabAndroid::RunExternalProtocolDialog(const GURL& url) { | 131 void TabAndroid::RunExternalProtocolDialog(const GURL& url) { |
136 } | 132 } |
137 | 133 |
138 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 134 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
139 return RegisterNativesImpl(env); | 135 return RegisterNativesImpl(env); |
140 } | 136 } |
OLD | NEW |