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/chrome_content_settings_client.h" | 9 #include "chrome/browser/content_settings/chrome_content_settings_client.h" |
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h" | 27 #include "chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h" |
28 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" | 28 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
29 #include "chrome/browser/ui/search/search_tab_helper.h" | 29 #include "chrome/browser/ui/search/search_tab_helper.h" |
30 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 30 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
31 #include "chrome/browser/ui/tab_dialogs.h" | 31 #include "chrome/browser/ui/tab_dialogs.h" |
32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
33 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 33 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
34 #include "components/autofill/core/browser/autofill_manager.h" | 34 #include "components/autofill/core/browser/autofill_manager.h" |
35 #include "components/dom_distiller/content/web_contents_main_frame_observer.h" | 35 #include "components/dom_distiller/content/web_contents_main_frame_observer.h" |
36 #include "components/password_manager/core/browser/password_manager.h" | 36 #include "components/password_manager/core/browser/password_manager.h" |
37 #include "components/signin/core/common/profile_management_switches.h" | |
38 #include "content/public/browser/web_contents.h" | 37 #include "content/public/browser/web_contents.h" |
39 | 38 |
40 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
41 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 40 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
42 #include "chrome/browser/ui/android/context_menu_helper.h" | 41 #include "chrome/browser/ui/android/context_menu_helper.h" |
43 #include "chrome/browser/ui/android/window_android_helper.h" | 42 #include "chrome/browser/ui/android/window_android_helper.h" |
44 #else | 43 #else |
45 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 44 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
46 #include "chrome/browser/net/predictor_tab_helper.h" | 45 #include "chrome/browser/net/predictor_tab_helper.h" |
47 #include "chrome/browser/plugins/plugin_observer.h" | 46 #include "chrome/browser/plugins/plugin_observer.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 78 |
80 #if defined(ENABLE_PRINTING) | 79 #if defined(ENABLE_PRINTING) |
81 #if defined(ENABLE_PRINT_PREVIEW) | 80 #if defined(ENABLE_PRINT_PREVIEW) |
82 #include "chrome/browser/printing/print_preview_message_handler.h" | 81 #include "chrome/browser/printing/print_preview_message_handler.h" |
83 #include "chrome/browser/printing/print_view_manager.h" | 82 #include "chrome/browser/printing/print_view_manager.h" |
84 #else | 83 #else |
85 #include "chrome/browser/printing/print_view_manager_basic.h" | 84 #include "chrome/browser/printing/print_view_manager_basic.h" |
86 #endif // defined(ENABLE_PRINT_PREVIEW) | 85 #endif // defined(ENABLE_PRINT_PREVIEW) |
87 #endif // defined(ENABLE_PRINTING) | 86 #endif // defined(ENABLE_PRINTING) |
88 | 87 |
89 #if defined(ENABLE_ONE_CLICK_SIGNIN) | |
90 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | |
91 #endif | |
92 | |
93 using content::WebContents; | 88 using content::WebContents; |
94 | 89 |
95 namespace { | 90 namespace { |
96 | 91 |
97 const char kTabContentsAttachedTabHelpersUserDataKey[] = | 92 const char kTabContentsAttachedTabHelpersUserDataKey[] = |
98 "TabContentsAttachedTabHelpers"; | 93 "TabContentsAttachedTabHelpers"; |
99 | 94 |
100 } // namespace | 95 } // namespace |
101 | 96 |
102 // static | 97 // static |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 207 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
213 #endif // defined(ENABLE_PRINT_PREVIEW) | 208 #endif // defined(ENABLE_PRINT_PREVIEW) |
214 #endif // defined(ENABLE_PRINTING) && !defined(OS_ANDROID) | 209 #endif // defined(ENABLE_PRINTING) && !defined(OS_ANDROID) |
215 | 210 |
216 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 211 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
217 switches::kEnableDomDistiller)) { | 212 switches::kEnableDomDistiller)) { |
218 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( | 213 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( |
219 web_contents); | 214 web_contents); |
220 } | 215 } |
221 | 216 |
222 #if defined(ENABLE_ONE_CLICK_SIGNIN) | |
223 // If this is not an incognito window, setup to handle one-click login. | |
224 // We don't want to check that the profile is already connected at this time | |
225 // because the connected state may change while this tab is open. Having a | |
226 // one-click signin helper attached does not cause problems if the profile | |
227 // happens to be already connected. | |
228 if (switches::IsEnableWebBasedSignin() && | |
229 OneClickSigninHelper::CanOffer(web_contents, | |
230 OneClickSigninHelper::CAN_OFFER_FOR_ALL, | |
231 std::string(), | |
232 NULL)) { | |
233 OneClickSigninHelper::CreateForWebContents(web_contents); | |
234 } | |
235 #endif | |
236 | |
237 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 217 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
238 web_contents->GetBrowserContext())) { | 218 web_contents->GetBrowserContext())) { |
239 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 219 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
240 web_contents); | 220 web_contents); |
241 } | 221 } |
242 } | 222 } |
OLD | NEW |