| 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/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| 11 #include "chrome/browser/favicon/favicon_tab_helper.h" | 11 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 12 #include "chrome/browser/history/history_tab_helper.h" | 12 #include "chrome/browser/history/history_tab_helper.h" |
| 13 #include "chrome/browser/infobars/infobar_service.h" | 13 #include "chrome/browser/infobars/infobar_service.h" |
| 14 #include "chrome/browser/net/net_error_tab_helper.h" | 14 #include "chrome/browser/net/net_error_tab_helper.h" |
| 15 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 15 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 16 #include "chrome/browser/prerender/prerender_tab_helper.h" | 16 #include "chrome/browser/prerender/prerender_tab_helper.h" |
| 17 #include "chrome/browser/sessions/session_tab_helper.h" | 17 #include "chrome/browser/sessions/session_tab_helper.h" |
| 18 #include "chrome/browser/ssl/ssl_tab_helper.h" | 18 #include "chrome/browser/ssl/ssl_tab_helper.h" |
| 19 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" | 19 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
| 20 #include "chrome/browser/translate/translate_tab_helper.h" | 20 #include "chrome/browser/translate/translate_tab_helper.h" |
| 21 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" | 21 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
| 22 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 22 #include "chrome/browser/ui/blocked_content/popup_blocker_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/find_bar/find_tab_helper.h" | 24 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 25 #include "chrome/browser/ui/navigation_correction_tab_observer.h" | 25 #include "chrome/browser/ui/navigation_correction_tab_observer.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/search/search_tab_helper.h" | 27 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 28 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 28 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 30 #include "components/autofill/content/browser/content_autofill_driver.h" | 30 #include "components/autofill/content/browser/content_autofill_driver.h" |
| 31 #include "components/autofill/core/browser/autofill_manager.h" | 31 #include "components/autofill/core/browser/autofill_manager.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); | 106 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); |
| 107 | 107 |
| 108 // Create all the tab helpers. | 108 // Create all the tab helpers. |
| 109 | 109 |
| 110 // SessionTabHelper comes first because it sets up the tab ID, and other | 110 // SessionTabHelper comes first because it sets up the tab ID, and other |
| 111 // helpers may rely on that. | 111 // helpers may rely on that. |
| 112 SessionTabHelper::CreateForWebContents(web_contents); | 112 SessionTabHelper::CreateForWebContents(web_contents); |
| 113 | 113 |
| 114 // --- Common tab helpers --- | 114 // --- Common tab helpers --- |
| 115 | 115 |
| 116 autofill::TabAutofillManagerDelegate::CreateForWebContents(web_contents); | 116 autofill::ChromeAutofillClient::CreateForWebContents(web_contents); |
| 117 autofill::ContentAutofillDriver::CreateForWebContentsAndDelegate( | 117 autofill::ContentAutofillDriver::CreateForWebContentsAndDelegate( |
| 118 web_contents, | 118 web_contents, |
| 119 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents), | 119 autofill::ChromeAutofillClient::FromWebContents(web_contents), |
| 120 g_browser_process->GetApplicationLocale(), | 120 g_browser_process->GetApplicationLocale(), |
| 121 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); | 121 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); |
| 122 BookmarkTabHelper::CreateForWebContents(web_contents); | 122 BookmarkTabHelper::CreateForWebContents(web_contents); |
| 123 chrome_browser_net::NetErrorTabHelper::CreateForWebContents(web_contents); | 123 chrome_browser_net::NetErrorTabHelper::CreateForWebContents(web_contents); |
| 124 ChromePasswordManagerClient::CreateForWebContentsWithAutofillManagerDelegate( | 124 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( |
| 125 web_contents, | 125 web_contents, |
| 126 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents)); | 126 autofill::ChromeAutofillClient::FromWebContents(web_contents)); |
| 127 CoreTabHelper::CreateForWebContents(web_contents); | 127 CoreTabHelper::CreateForWebContents(web_contents); |
| 128 extensions::TabHelper::CreateForWebContents(web_contents); | 128 extensions::TabHelper::CreateForWebContents(web_contents); |
| 129 FaviconTabHelper::CreateForWebContents(web_contents); | 129 FaviconTabHelper::CreateForWebContents(web_contents); |
| 130 FindTabHelper::CreateForWebContents(web_contents); | 130 FindTabHelper::CreateForWebContents(web_contents); |
| 131 HistoryTabHelper::CreateForWebContents(web_contents); | 131 HistoryTabHelper::CreateForWebContents(web_contents); |
| 132 InfoBarService::CreateForWebContents(web_contents); | 132 InfoBarService::CreateForWebContents(web_contents); |
| 133 NavigationCorrectionTabObserver::CreateForWebContents(web_contents); | 133 NavigationCorrectionTabObserver::CreateForWebContents(web_contents); |
| 134 NavigationMetricsRecorder::CreateForWebContents(web_contents); | 134 NavigationMetricsRecorder::CreateForWebContents(web_contents); |
| 135 PopupBlockerTabHelper::CreateForWebContents(web_contents); | 135 PopupBlockerTabHelper::CreateForWebContents(web_contents); |
| 136 PrefsTabHelper::CreateForWebContents(web_contents); | 136 PrefsTabHelper::CreateForWebContents(web_contents); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 if (OneClickSigninHelper::CanOffer(web_contents, | 205 if (OneClickSigninHelper::CanOffer(web_contents, |
| 206 OneClickSigninHelper::CAN_OFFER_FOR_ALL, | 206 OneClickSigninHelper::CAN_OFFER_FOR_ALL, |
| 207 std::string(), | 207 std::string(), |
| 208 NULL)) { | 208 NULL)) { |
| 209 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( | 209 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( |
| 210 web_contents, | 210 web_contents, |
| 211 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); | 211 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); |
| 212 } | 212 } |
| 213 #endif | 213 #endif |
| 214 } | 214 } |
| OLD | NEW |