| 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 29 matching lines...) Expand all Loading... |
| 40 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
| 41 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 41 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
| 42 #include "components/autofill/core/browser/autofill_manager.h" | 42 #include "components/autofill/core/browser/autofill_manager.h" |
| 43 #include "components/dom_distiller/content/browser/web_contents_main_frame_obser
ver.h" | 43 #include "components/dom_distiller/content/browser/web_contents_main_frame_obser
ver.h" |
| 44 #include "components/dom_distiller/core/dom_distiller_switches.h" | 44 #include "components/dom_distiller/core/dom_distiller_switches.h" |
| 45 #include "components/history/content/browser/web_contents_top_sites_observer.h" | 45 #include "components/history/content/browser/web_contents_top_sites_observer.h" |
| 46 #include "components/history/core/browser/top_sites.h" | 46 #include "components/history/core/browser/top_sites.h" |
| 47 #include "components/password_manager/core/browser/password_manager.h" | 47 #include "components/password_manager/core/browser/password_manager.h" |
| 48 #include "content/public/browser/web_contents.h" | 48 #include "content/public/browser/web_contents.h" |
| 49 | 49 |
| 50 #if defined(OS_ANDROID) | 50 #if defined(OS_ANDROID) && !defined(USE_AURA) |
| 51 #include "chrome/browser/android/offline_pages/offline_page_web_contents_observe
r.h" | 51 #include "chrome/browser/android/offline_pages/offline_page_web_contents_observe
r.h" |
| 52 #include "chrome/browser/android/voice_search_tab_helper.h" | 52 #include "chrome/browser/android/voice_search_tab_helper.h" |
| 53 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 53 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
| 54 #include "chrome/browser/ui/android/context_menu_helper.h" | 54 #include "chrome/browser/ui/android/context_menu_helper.h" |
| 55 #include "chrome/browser/ui/android/window_android_helper.h" | 55 #include "chrome/browser/ui/android/window_android_helper.h" |
| 56 #else | 56 #else |
| 57 #include "chrome/browser/banners/app_banner_manager_desktop.h" | 57 #include "chrome/browser/banners/app_banner_manager_desktop.h" |
| 58 #include "chrome/browser/plugins/plugin_observer.h" | 58 #include "chrome/browser/plugins/plugin_observer.h" |
| 59 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 59 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
| 60 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" | 60 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" |
| 61 #include "chrome/browser/ui/hung_plugin_tab_helper.h" | 61 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
| 62 #include "chrome/browser/ui/sad_tab_helper.h" | 62 #include "chrome/browser/ui/sad_tab_helper.h" |
| 63 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 63 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 64 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | 64 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" |
| 65 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 65 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 66 #include "components/pdf/browser/pdf_web_contents_helper.h" | 66 #include "components/pdf/browser/pdf_web_contents_helper.h" |
| 67 #include "components/ui/zoom/zoom_controller.h" | 67 #include "components/ui/zoom/zoom_controller.h" |
| 68 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 68 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 69 #endif // defined(OS_ANDROID) | 69 #endif // defined(OS_ANDROID) && !defined(USE_AURA) |
| 70 | 70 |
| 71 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
| 72 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" | 72 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 75 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 76 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 76 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 #if defined(ENABLE_EXTENSIONS) | 79 #if defined(ENABLE_EXTENSIONS) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 #if defined(ENABLE_EXTENSIONS) | 120 #if defined(ENABLE_EXTENSIONS) |
| 121 // Set the view type. | 121 // Set the view type. |
| 122 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); | 122 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); |
| 123 #endif | 123 #endif |
| 124 | 124 |
| 125 // Create all the tab helpers. | 125 // Create all the tab helpers. |
| 126 | 126 |
| 127 // SessionTabHelper comes first because it sets up the tab ID, and other | 127 // SessionTabHelper comes first because it sets up the tab ID, and other |
| 128 // helpers may rely on that. | 128 // helpers may rely on that. |
| 129 SessionTabHelper::CreateForWebContents(web_contents); | 129 SessionTabHelper::CreateForWebContents(web_contents); |
| 130 #if !defined(OS_ANDROID) | 130 #if !defined(OS_ANDROID) || defined(USE_AURA) |
| 131 // ZoomController comes before common tab helpers since ChromeAutofillClient | 131 // ZoomController comes before common tab helpers since ChromeAutofillClient |
| 132 // may want to register as a ZoomObserver with it. | 132 // may want to register as a ZoomObserver with it. |
| 133 ui_zoom::ZoomController::CreateForWebContents(web_contents); | 133 ui_zoom::ZoomController::CreateForWebContents(web_contents); |
| 134 #endif | 134 #endif |
| 135 | 135 |
| 136 // --- Common tab helpers --- | 136 // --- Common tab helpers --- |
| 137 | 137 |
| 138 autofill::ChromeAutofillClient::CreateForWebContents(web_contents); | 138 autofill::ChromeAutofillClient::CreateForWebContents(web_contents); |
| 139 autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( | 139 autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( |
| 140 web_contents, | 140 web_contents, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 167 prerender::PrerenderTabHelper::CreateForWebContents(web_contents); | 167 prerender::PrerenderTabHelper::CreateForWebContents(web_contents); |
| 168 SearchTabHelper::CreateForWebContents(web_contents); | 168 SearchTabHelper::CreateForWebContents(web_contents); |
| 169 if (SiteEngagementService::IsEnabled()) | 169 if (SiteEngagementService::IsEnabled()) |
| 170 SiteEngagementHelper::CreateForWebContents(web_contents); | 170 SiteEngagementHelper::CreateForWebContents(web_contents); |
| 171 // TODO(vabr): Remove TabSpecificContentSettings from here once their function | 171 // TODO(vabr): Remove TabSpecificContentSettings from here once their function |
| 172 // is taken over by ChromeContentSettingsClient. http://crbug.com/387075 | 172 // is taken over by ChromeContentSettingsClient. http://crbug.com/387075 |
| 173 TabSpecificContentSettings::CreateForWebContents(web_contents); | 173 TabSpecificContentSettings::CreateForWebContents(web_contents); |
| 174 | 174 |
| 175 // --- Platform-specific tab helpers --- | 175 // --- Platform-specific tab helpers --- |
| 176 | 176 |
| 177 #if defined(OS_ANDROID) | 177 #if defined(OS_ANDROID) && !defined(USE_AURA) |
| 178 ContextMenuHelper::CreateForWebContents(web_contents); | 178 ContextMenuHelper::CreateForWebContents(web_contents); |
| 179 offline_pages::OfflinePageWebContentsObserver::CreateForWebContents( | 179 offline_pages::OfflinePageWebContentsObserver::CreateForWebContents( |
| 180 web_contents); | 180 web_contents); |
| 181 SingleTabModeTabHelper::CreateForWebContents(web_contents); | 181 SingleTabModeTabHelper::CreateForWebContents(web_contents); |
| 182 VoiceSearchTabHelper::CreateForWebContents(web_contents); | 182 VoiceSearchTabHelper::CreateForWebContents(web_contents); |
| 183 WindowAndroidHelper::CreateForWebContents(web_contents); | 183 WindowAndroidHelper::CreateForWebContents(web_contents); |
| 184 #else | 184 #else |
| 185 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 185 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 186 web_contents); | 186 web_contents); |
| 187 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); | 187 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 web_contents); | 244 web_contents); |
| 245 } | 245 } |
| 246 | 246 |
| 247 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 247 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 248 switches::kEnableNavigationTracing) && | 248 switches::kEnableNavigationTracing) && |
| 249 base::CommandLine::ForCurrentProcess()->HasSwitch( | 249 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 250 switches::kTraceUploadURL)) { | 250 switches::kTraceUploadURL)) { |
| 251 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 251 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
| 252 } | 252 } |
| 253 } | 253 } |
| OLD | NEW |