| 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/tab_contents/navigation_metrics_recorder.h" | 18 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
| 19 #include "chrome/browser/translate/chrome_translate_client.h" | 19 #include "chrome/browser/translate/chrome_translate_client.h" |
| 20 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" | 20 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
| 21 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 21 #include "chrome/browser/ui/blocked_content/popup_blocker_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/find_bar/find_tab_helper.h" | 23 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 24 #include "chrome/browser/ui/navigation_correction_tab_observer.h" | 24 #include "chrome/browser/ui/navigation_correction_tab_observer.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/search/search_tab_helper.h" | 26 #include "chrome/browser/ui/search/search_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/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "components/autofill/content/browser/content_autofill_driver.h" | 29 #include "components/autofill/content/browser/content_autofill_driver.h" |
| 30 #include "components/autofill/core/browser/autofill_manager.h" | 30 #include "components/autofill/core/browser/autofill_manager.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); | 105 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); |
| 106 | 106 |
| 107 // Create all the tab helpers. | 107 // Create all the tab helpers. |
| 108 | 108 |
| 109 // SessionTabHelper comes first because it sets up the tab ID, and other | 109 // SessionTabHelper comes first because it sets up the tab ID, and other |
| 110 // helpers may rely on that. | 110 // helpers may rely on that. |
| 111 SessionTabHelper::CreateForWebContents(web_contents); | 111 SessionTabHelper::CreateForWebContents(web_contents); |
| 112 | 112 |
| 113 // --- Common tab helpers --- | 113 // --- Common tab helpers --- |
| 114 | 114 |
| 115 autofill::TabAutofillManagerDelegate::CreateForWebContents(web_contents); | 115 autofill::ChromeAutofillClient::CreateForWebContents(web_contents); |
| 116 autofill::ContentAutofillDriver::CreateForWebContentsAndDelegate( | 116 autofill::ContentAutofillDriver::CreateForWebContentsAndDelegate( |
| 117 web_contents, | 117 web_contents, |
| 118 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents), | 118 autofill::ChromeAutofillClient::FromWebContents(web_contents), |
| 119 g_browser_process->GetApplicationLocale(), | 119 g_browser_process->GetApplicationLocale(), |
| 120 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); | 120 autofill::AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); |
| 121 BookmarkTabHelper::CreateForWebContents(web_contents); | 121 BookmarkTabHelper::CreateForWebContents(web_contents); |
| 122 chrome_browser_net::NetErrorTabHelper::CreateForWebContents(web_contents); | 122 chrome_browser_net::NetErrorTabHelper::CreateForWebContents(web_contents); |
| 123 ChromePasswordManagerClient::CreateForWebContentsWithAutofillManagerDelegate( | 123 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( |
| 124 web_contents, | 124 web_contents, |
| 125 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents)); | 125 autofill::ChromeAutofillClient::FromWebContents(web_contents)); |
| 126 CoreTabHelper::CreateForWebContents(web_contents); | 126 CoreTabHelper::CreateForWebContents(web_contents); |
| 127 extensions::TabHelper::CreateForWebContents(web_contents); | 127 extensions::TabHelper::CreateForWebContents(web_contents); |
| 128 FaviconTabHelper::CreateForWebContents(web_contents); | 128 FaviconTabHelper::CreateForWebContents(web_contents); |
| 129 FindTabHelper::CreateForWebContents(web_contents); | 129 FindTabHelper::CreateForWebContents(web_contents); |
| 130 HistoryTabHelper::CreateForWebContents(web_contents); | 130 HistoryTabHelper::CreateForWebContents(web_contents); |
| 131 InfoBarService::CreateForWebContents(web_contents); | 131 InfoBarService::CreateForWebContents(web_contents); |
| 132 NavigationCorrectionTabObserver::CreateForWebContents(web_contents); | 132 NavigationCorrectionTabObserver::CreateForWebContents(web_contents); |
| 133 NavigationMetricsRecorder::CreateForWebContents(web_contents); | 133 NavigationMetricsRecorder::CreateForWebContents(web_contents); |
| 134 PopupBlockerTabHelper::CreateForWebContents(web_contents); | 134 PopupBlockerTabHelper::CreateForWebContents(web_contents); |
| 135 PrefsTabHelper::CreateForWebContents(web_contents); | 135 PrefsTabHelper::CreateForWebContents(web_contents); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 if (OneClickSigninHelper::CanOffer(web_contents, | 203 if (OneClickSigninHelper::CanOffer(web_contents, |
| 204 OneClickSigninHelper::CAN_OFFER_FOR_ALL, | 204 OneClickSigninHelper::CAN_OFFER_FOR_ALL, |
| 205 std::string(), | 205 std::string(), |
| 206 NULL)) { | 206 NULL)) { |
| 207 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( | 207 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( |
| 208 web_contents, | 208 web_contents, |
| 209 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); | 209 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); |
| 210 } | 210 } |
| 211 #endif | 211 #endif |
| 212 } | 212 } |
| OLD | NEW |