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/browser/ui/tab_helpers.h" | 5 #include "chrome/browser/ui/tab_helpers.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
10 #include "chrome/browser/favicon/favicon_tab_helper.h" | 10 #include "chrome/browser/favicon/favicon_tab_helper.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 new base::SupportsUserData::Data()); | 105 new base::SupportsUserData::Data()); |
106 | 106 |
107 // Set the view type. | 107 // Set the view type. |
108 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); | 108 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); |
109 | 109 |
110 // Create all the tab helpers. | 110 // Create all the tab helpers. |
111 | 111 |
112 // SessionTabHelper comes first because it sets up the tab ID, and other | 112 // SessionTabHelper comes first because it sets up the tab ID, and other |
113 // helpers may rely on that. | 113 // helpers may rely on that. |
114 SessionTabHelper::CreateForWebContents(web_contents); | 114 SessionTabHelper::CreateForWebContents(web_contents); |
| 115 #if !defined(OS_ANDROID) |
| 116 // ZoomController comes before common tab helpers since ChromeAutofillClient |
| 117 // may want to register as a ZoomObserver with it. |
| 118 ZoomController::CreateForWebContents(web_contents); |
| 119 #endif |
115 | 120 |
116 // --- Common tab helpers --- | 121 // --- Common tab helpers --- |
117 | 122 |
118 autofill::ChromeAutofillClient::CreateForWebContents(web_contents); | 123 autofill::ChromeAutofillClient::CreateForWebContents(web_contents); |
119 autofill::ContentAutofillDriver::CreateForWebContentsAndDelegate( | 124 autofill::ContentAutofillDriver::CreateForWebContentsAndDelegate( |
120 web_contents, | 125 web_contents, |
121 autofill::ChromeAutofillClient::FromWebContents(web_contents), | 126 autofill::ChromeAutofillClient::FromWebContents(web_contents), |
122 g_browser_process->GetApplicationLocale(), | 127 g_browser_process->GetApplicationLocale(), |
123 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); | 128 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); |
124 BookmarkTabHelper::CreateForWebContents(web_contents); | 129 BookmarkTabHelper::CreateForWebContents(web_contents); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 ManagePasswordsUIController::CreateForWebContents(web_contents); | 162 ManagePasswordsUIController::CreateForWebContents(web_contents); |
158 PDFTabHelper::CreateForWebContents(web_contents); | 163 PDFTabHelper::CreateForWebContents(web_contents); |
159 PermissionBubbleManager::CreateForWebContents(web_contents); | 164 PermissionBubbleManager::CreateForWebContents(web_contents); |
160 PluginObserver::CreateForWebContents(web_contents); | 165 PluginObserver::CreateForWebContents(web_contents); |
161 SadTabHelper::CreateForWebContents(web_contents); | 166 SadTabHelper::CreateForWebContents(web_contents); |
162 safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents); | 167 safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents); |
163 SearchEngineTabHelper::CreateForWebContents(web_contents); | 168 SearchEngineTabHelper::CreateForWebContents(web_contents); |
164 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); | 169 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); |
165 ThumbnailTabHelper::CreateForWebContents(web_contents); | 170 ThumbnailTabHelper::CreateForWebContents(web_contents); |
166 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); | 171 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); |
167 ZoomController::CreateForWebContents(web_contents); | |
168 #endif | 172 #endif |
169 | 173 |
170 #if defined(OS_WIN) | 174 #if defined(OS_WIN) |
171 MetroPinTabHelper::CreateForWebContents(web_contents); | 175 MetroPinTabHelper::CreateForWebContents(web_contents); |
172 #endif | 176 #endif |
173 | 177 |
174 // --- Feature tab helpers behind flags --- | 178 // --- Feature tab helpers behind flags --- |
175 | 179 |
176 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 180 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
177 CaptivePortalTabHelper::CreateForWebContents(web_contents); | 181 CaptivePortalTabHelper::CreateForWebContents(web_contents); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 if (OneClickSigninHelper::CanOffer(web_contents, | 213 if (OneClickSigninHelper::CanOffer(web_contents, |
210 OneClickSigninHelper::CAN_OFFER_FOR_ALL, | 214 OneClickSigninHelper::CAN_OFFER_FOR_ALL, |
211 std::string(), | 215 std::string(), |
212 NULL)) { | 216 NULL)) { |
213 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( | 217 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( |
214 web_contents, | 218 web_contents, |
215 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); | 219 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); |
216 } | 220 } |
217 #endif | 221 #endif |
218 } | 222 } |
OLD | NEW |