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" |
(...skipping 11 matching lines...) Expand all Loading... | |
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" |
32 #include "components/dom_distiller/content/web_contents_main_frame_observer.h" | |
32 #include "components/password_manager/core/browser/password_manager.h" | 33 #include "components/password_manager/core/browser/password_manager.h" |
33 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
34 #include "extensions/browser/view_type_utils.h" | 35 #include "extensions/browser/view_type_utils.h" |
35 | 36 |
36 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
37 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 38 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
38 #include "chrome/browser/ui/android/context_menu_helper.h" | 39 #include "chrome/browser/ui/android/context_menu_helper.h" |
39 #include "chrome/browser/ui/android/window_android_helper.h" | 40 #include "chrome/browser/ui/android/window_android_helper.h" |
40 #else | 41 #else |
41 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 42 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 | 185 |
185 #if defined(ENABLE_PRINTING) && !defined(OS_ANDROID) | 186 #if defined(ENABLE_PRINTING) && !defined(OS_ANDROID) |
186 #if defined(ENABLE_FULL_PRINTING) | 187 #if defined(ENABLE_FULL_PRINTING) |
187 printing::PrintViewManager::CreateForWebContents(web_contents); | 188 printing::PrintViewManager::CreateForWebContents(web_contents); |
188 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 189 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
189 #else | 190 #else |
190 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 191 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
191 #endif // defined(ENABLE_FULL_PRINTING) | 192 #endif // defined(ENABLE_FULL_PRINTING) |
192 #endif // defined(ENABLE_PRINTING) && !defined(OS_ANDROID) | 193 #endif // defined(ENABLE_PRINTING) && !defined(OS_ANDROID) |
193 | 194 |
195 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
196 switches::kEnableDomDistiller)) { | |
197 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( | |
sky
2014/05/20 20:59:45
Why do we need to do this here? Can't you install
nyquist
2014/05/20 21:03:28
The WebContentsMainFrameObserver is only there to
sky
2014/05/20 23:25:20
Can't you determine what you need at the time you
nyquist
2014/05/20 23:28:11
That would be great, but I could not find any plac
| |
198 web_contents); | |
199 } | |
200 | |
194 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 201 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
195 // If this is not an incognito window, setup to handle one-click login. | 202 // If this is not an incognito window, setup to handle one-click login. |
196 // We don't want to check that the profile is already connected at this time | 203 // We don't want to check that the profile is already connected at this time |
197 // because the connected state may change while this tab is open. Having a | 204 // because the connected state may change while this tab is open. Having a |
198 // one-click signin helper attached does not cause problems if the profile | 205 // one-click signin helper attached does not cause problems if the profile |
199 // happens to be already connected. | 206 // happens to be already connected. |
200 if (OneClickSigninHelper::CanOffer(web_contents, | 207 if (OneClickSigninHelper::CanOffer(web_contents, |
201 OneClickSigninHelper::CAN_OFFER_FOR_ALL, | 208 OneClickSigninHelper::CAN_OFFER_FOR_ALL, |
202 std::string(), | 209 std::string(), |
203 NULL)) { | 210 NULL)) { |
204 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( | 211 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( |
205 web_contents, | 212 web_contents, |
206 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); | 213 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); |
207 } | 214 } |
208 #endif | 215 #endif |
209 } | 216 } |
OLD | NEW |