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/content_settings/tab_specific_content_settings.h" | 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
8 #include "chrome/browser/extensions/tab_helper.h" | 8 #include "chrome/browser/extensions/tab_helper.h" |
9 #include "chrome/browser/favicon/favicon_tab_helper.h" | 9 #include "chrome/browser/favicon/favicon_tab_helper.h" |
10 #include "chrome/browser/history/history_tab_helper.h" | 10 #include "chrome/browser/history/history_tab_helper.h" |
11 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
12 #include "chrome/browser/password_manager/password_manager.h" | 12 #include "chrome/browser/password_manager/password_manager.h" |
13 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" | 13 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
14 #include "chrome/browser/prerender/prerender_tab_helper.h" | 14 #include "chrome/browser/prerender/prerender_tab_helper.h" |
15 #include "chrome/browser/sessions/session_tab_helper.h" | 15 #include "chrome/browser/sessions/session_tab_helper.h" |
16 #include "chrome/browser/ssl/ssl_tab_helper.h" | 16 #include "chrome/browser/ssl/ssl_tab_helper.h" |
17 #include "chrome/browser/translate/translate_tab_helper.h" | 17 #include "chrome/browser/translate/translate_tab_helper.h" |
18 #include "chrome/browser/ui/alternate_error_tab_observer.h" | 18 #include "chrome/browser/ui/alternate_error_tab_observer.h" |
19 #include "chrome/browser/ui/android/window_android_helper.h" | 19 #include "chrome/browser/ui/android/window_android_helper.h" |
20 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" | 20 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" |
21 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 21 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
22 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 22 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
23 #include "chrome/browser/ui/browser_tab_contents.h" | 23 #include "chrome/browser/ui/browser_tab_contents.h" |
24 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 24 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
25 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" | 25 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
26 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | 26 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.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 "chrome/browser/view_type_utils.h" | |
30 #include "components/autofill/browser/autofill_external_delegate.h" | 29 #include "components/autofill/browser/autofill_external_delegate.h" |
31 #include "components/autofill/browser/autofill_manager.h" | 30 #include "components/autofill/browser/autofill_manager.h" |
32 #include "content/public/browser/android/content_view_core.h" | 31 #include "content/public/browser/android/content_view_core.h" |
33 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 33 #include "extensions/browser/view_type_utils.h" |
34 #include "jni/TabBase_jni.h" | 34 #include "jni/TabBase_jni.h" |
35 | 35 |
36 using content::WebContents; | 36 using content::WebContents; |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 const char kTabHelpersInitializedUserDataKey[] = | 40 const char kTabHelpersInitializedUserDataKey[] = |
41 "TabAndroidTabHelpersInitialized"; | 41 "TabAndroidTabHelpersInitialized"; |
42 | 42 |
43 } // namespace | 43 } // namespace |
44 | 44 |
45 void BrowserTabContents::AttachTabHelpers(WebContents* contents) { | 45 void BrowserTabContents::AttachTabHelpers(WebContents* contents) { |
46 // If already initialized, nothing to be done. | 46 // If already initialized, nothing to be done. |
47 base::SupportsUserData::Data* initialization_tag = | 47 base::SupportsUserData::Data* initialization_tag = |
48 contents->GetUserData(&kTabHelpersInitializedUserDataKey); | 48 contents->GetUserData(&kTabHelpersInitializedUserDataKey); |
49 if (initialization_tag) | 49 if (initialization_tag) |
50 return; | 50 return; |
51 | 51 |
52 // Mark as initialized. | 52 // Mark as initialized. |
53 contents->SetUserData(&kTabHelpersInitializedUserDataKey, | 53 contents->SetUserData(&kTabHelpersInitializedUserDataKey, |
54 new base::SupportsUserData::Data()); | 54 new base::SupportsUserData::Data()); |
55 | 55 |
56 // Set the view type. | 56 // Set the view type. |
57 chrome::SetViewType(contents, chrome::VIEW_TYPE_TAB_CONTENTS); | 57 extensions::SetViewType(contents, extensions::VIEW_TYPE_TAB_CONTENTS); |
58 | 58 |
59 // SessionTabHelper comes first because it sets up the tab ID, and other | 59 // SessionTabHelper comes first because it sets up the tab ID, and other |
60 // helpers may rely on that. | 60 // helpers may rely on that. |
61 SessionTabHelper::CreateForWebContents(contents); | 61 SessionTabHelper::CreateForWebContents(contents); |
62 | 62 |
63 AlternateErrorPageTabObserver::CreateForWebContents(contents); | 63 AlternateErrorPageTabObserver::CreateForWebContents(contents); |
64 autofill::TabAutofillManagerDelegate::CreateForWebContents(contents); | 64 autofill::TabAutofillManagerDelegate::CreateForWebContents(contents); |
65 AutofillManager::CreateForWebContentsAndDelegate( | 65 AutofillManager::CreateForWebContentsAndDelegate( |
66 contents, | 66 contents, |
67 autofill::TabAutofillManagerDelegate::FromWebContents(contents)); | 67 autofill::TabAutofillManagerDelegate::FromWebContents(contents)); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 ToolbarModel::SecurityLevel TabAndroid::GetSecurityLevel() { | 126 ToolbarModel::SecurityLevel TabAndroid::GetSecurityLevel() { |
127 return ToolbarModelImpl::GetSecurityLevelForWebContents(GetWebContents()); | 127 return ToolbarModelImpl::GetSecurityLevelForWebContents(GetWebContents()); |
128 } | 128 } |
129 | 129 |
130 void TabAndroid::RunExternalProtocolDialog(const GURL& url) { | 130 void TabAndroid::RunExternalProtocolDialog(const GURL& url) { |
131 } | 131 } |
132 | 132 |
133 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 133 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
134 return RegisterNativesImpl(env); | 134 return RegisterNativesImpl(env); |
135 } | 135 } |
OLD | NEW |