| 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/ui/browser_tab_contents.h" | 5 #include "chrome/browser/ui/browser_tab_contents.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/api/web_navigation/web_navigation_api.h" | 10 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
| 11 #include "chrome/browser/extensions/extension_web_contents_observer.h" | 11 #include "chrome/browser/extensions/extension_web_contents_observer.h" |
| 12 #include "chrome/browser/extensions/tab_helper.h" | 12 #include "chrome/browser/extensions/tab_helper.h" |
| 13 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 13 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
| 14 #include "chrome/browser/favicon/favicon_tab_helper.h" | 14 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 15 #include "chrome/browser/history/history_tab_helper.h" | 15 #include "chrome/browser/history/history_tab_helper.h" |
| 16 #include "chrome/browser/infobars/infobar_service.h" | 16 #include "chrome/browser/infobars/infobar_service.h" |
| 17 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" | 17 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" |
| 18 #include "chrome/browser/net/net_error_tab_helper.h" | 18 #include "chrome/browser/net/net_error_tab_helper.h" |
| 19 #include "chrome/browser/net/predictor_tab_helper.h" | 19 #include "chrome/browser/net/predictor_tab_helper.h" |
| 20 #include "chrome/browser/network_time/navigation_time_helper.h" | 20 #include "chrome/browser/network_time/navigation_time_helper.h" |
| 21 #include "chrome/browser/password_manager/password_generation_manager.h" | 21 #include "chrome/browser/password_manager/password_generation_manager.h" |
| 22 #include "chrome/browser/password_manager/password_manager.h" | 22 #include "chrome/browser/password_manager/password_manager.h" |
| 23 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" | 23 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
| 24 #include "chrome/browser/plugins/plugin_observer.h" | 24 #include "chrome/browser/plugins/plugin_observer.h" |
| 25 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | |
| 26 #include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h" | |
| 27 #include "chrome/browser/prerender/prerender_tab_helper.h" | 25 #include "chrome/browser/prerender/prerender_tab_helper.h" |
| 28 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
| 29 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 27 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
| 30 #include "chrome/browser/sessions/session_tab_helper.h" | 28 #include "chrome/browser/sessions/session_tab_helper.h" |
| 31 #include "chrome/browser/ssl/ssl_tab_helper.h" | 29 #include "chrome/browser/ssl/ssl_tab_helper.h" |
| 32 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" | 30 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
| 33 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" | 31 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" |
| 34 #include "chrome/browser/translate/translate_tab_helper.h" | 32 #include "chrome/browser/translate/translate_tab_helper.h" |
| 35 #include "chrome/browser/ui/alternate_error_tab_observer.h" | 33 #include "chrome/browser/ui/alternate_error_tab_observer.h" |
| 36 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" | 34 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 ZoomController::CreateForWebContents(web_contents); | 160 ZoomController::CreateForWebContents(web_contents); |
| 163 | 161 |
| 164 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 162 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 165 captive_portal::CaptivePortalTabHelper::CreateForWebContents(web_contents); | 163 captive_portal::CaptivePortalTabHelper::CreateForWebContents(web_contents); |
| 166 #endif | 164 #endif |
| 167 | 165 |
| 168 if (profile->IsManaged()) { | 166 if (profile->IsManaged()) { |
| 169 ManagedModeNavigationObserver::CreateForWebContents(web_contents); | 167 ManagedModeNavigationObserver::CreateForWebContents(web_contents); |
| 170 } | 168 } |
| 171 | 169 |
| 172 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile(profile)) { | |
| 173 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | |
| 174 web_contents); | |
| 175 } | |
| 176 | |
| 177 #if defined(ENABLE_PRINTING) | 170 #if defined(ENABLE_PRINTING) |
| 178 #if defined(ENABLE_FULL_PRINTING) | 171 #if defined(ENABLE_FULL_PRINTING) |
| 179 printing::PrintViewManager::CreateForWebContents(web_contents); | 172 printing::PrintViewManager::CreateForWebContents(web_contents); |
| 180 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 173 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
| 181 #else | 174 #else |
| 182 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 175 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
| 183 #endif // defined(ENABLE_FULL_PRINTING) | 176 #endif // defined(ENABLE_FULL_PRINTING) |
| 184 #endif // defined(ENABLE_PRINTING) | 177 #endif // defined(ENABLE_PRINTING) |
| 185 | 178 |
| 186 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 179 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 187 // If this is not an incognito window, setup to handle one-click login. | 180 // If this is not an incognito window, setup to handle one-click login. |
| 188 // We don't want to check that the profile is already connected at this time | 181 // We don't want to check that the profile is already connected at this time |
| 189 // because the connected state may change while this tab is open. Having a | 182 // because the connected state may change while this tab is open. Having a |
| 190 // one-click signin helper attached does not cause problems if the profile | 183 // one-click signin helper attached does not cause problems if the profile |
| 191 // happens to be already connected. | 184 // happens to be already connected. |
| 192 if (OneClickSigninHelper::CanOffer(web_contents, | 185 if (OneClickSigninHelper::CanOffer(web_contents, |
| 193 OneClickSigninHelper::CAN_OFFER_FOR_ALL, | 186 OneClickSigninHelper::CAN_OFFER_FOR_ALL, |
| 194 std::string(), | 187 std::string(), |
| 195 NULL)) { | 188 NULL)) { |
| 196 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( | 189 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( |
| 197 web_contents, PasswordManager::FromWebContents(web_contents)); | 190 web_contents, PasswordManager::FromWebContents(web_contents)); |
| 198 } | 191 } |
| 199 #endif | 192 #endif |
| 200 | 193 |
| 201 #if defined(OS_WIN) | 194 #if defined(OS_WIN) |
| 202 MetroPinTabHelper::CreateForWebContents(web_contents); | 195 MetroPinTabHelper::CreateForWebContents(web_contents); |
| 203 #endif | 196 #endif |
| 204 } | 197 } |
| OLD | NEW |