| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 183 |
| 183 #if defined(ENABLE_PRINTING) && !defined(OS_ANDROID) | 184 #if defined(ENABLE_PRINTING) && !defined(OS_ANDROID) |
| 184 #if defined(ENABLE_FULL_PRINTING) | 185 #if defined(ENABLE_FULL_PRINTING) |
| 185 printing::PrintViewManager::CreateForWebContents(web_contents); | 186 printing::PrintViewManager::CreateForWebContents(web_contents); |
| 186 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 187 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
| 187 #else | 188 #else |
| 188 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 189 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
| 189 #endif // defined(ENABLE_FULL_PRINTING) | 190 #endif // defined(ENABLE_FULL_PRINTING) |
| 190 #endif // defined(ENABLE_PRINTING) && !defined(OS_ANDROID) | 191 #endif // defined(ENABLE_PRINTING) && !defined(OS_ANDROID) |
| 191 | 192 |
| 193 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 194 switches::kEnableDomDistiller)) { |
| 195 dom_distiller::WebContentsMainFrameObserver::CreateForWebContents( |
| 196 web_contents); |
| 197 } |
| 198 |
| 192 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 199 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 193 // If this is not an incognito window, setup to handle one-click login. | 200 // If this is not an incognito window, setup to handle one-click login. |
| 194 // We don't want to check that the profile is already connected at this time | 201 // We don't want to check that the profile is already connected at this time |
| 195 // because the connected state may change while this tab is open. Having a | 202 // because the connected state may change while this tab is open. Having a |
| 196 // one-click signin helper attached does not cause problems if the profile | 203 // one-click signin helper attached does not cause problems if the profile |
| 197 // happens to be already connected. | 204 // happens to be already connected. |
| 198 if (OneClickSigninHelper::CanOffer(web_contents, | 205 if (OneClickSigninHelper::CanOffer(web_contents, |
| 199 OneClickSigninHelper::CAN_OFFER_FOR_ALL, | 206 OneClickSigninHelper::CAN_OFFER_FOR_ALL, |
| 200 std::string(), | 207 std::string(), |
| 201 NULL)) { | 208 NULL)) { |
| 202 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( | 209 OneClickSigninHelper::CreateForWebContentsWithPasswordManager( |
| 203 web_contents, | 210 web_contents, |
| 204 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); | 211 ChromePasswordManagerClient::GetManagerFromWebContents(web_contents)); |
| 205 } | 212 } |
| 206 #endif | 213 #endif |
| 207 } | 214 } |
| OLD | NEW |