| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 42 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
| 43 #include "components/autofill/core/browser/autofill_manager.h" | 43 #include "components/autofill/core/browser/autofill_manager.h" |
| 44 #include "components/dom_distiller/content/browser/web_contents_main_frame_obser
ver.h" | 44 #include "components/dom_distiller/content/browser/web_contents_main_frame_obser
ver.h" |
| 45 #include "components/dom_distiller/core/dom_distiller_switches.h" | 45 #include "components/dom_distiller/core/dom_distiller_switches.h" |
| 46 #include "components/history/content/browser/web_contents_top_sites_observer.h" | 46 #include "components/history/content/browser/web_contents_top_sites_observer.h" |
| 47 #include "components/history/core/browser/top_sites.h" | 47 #include "components/history/core/browser/top_sites.h" |
| 48 #include "components/password_manager/core/browser/password_manager.h" | 48 #include "components/password_manager/core/browser/password_manager.h" |
| 49 #include "components/tracing/tracing_switches.h" | 49 #include "components/tracing/tracing_switches.h" |
| 50 #include "content/public/browser/web_contents.h" | 50 #include "content/public/browser/web_contents.h" |
| 51 | 51 |
| 52 #if defined(OS_ANDROID) | 52 #if defined(ANDROID_JAVA_UI) |
| 53 #include "chrome/browser/android/data_usage/data_use_tab_helper.h" | 53 #include "chrome/browser/android/data_usage/data_use_tab_helper.h" |
| 54 #include "chrome/browser/android/voice_search_tab_helper.h" | 54 #include "chrome/browser/android/voice_search_tab_helper.h" |
| 55 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 55 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
| 56 #include "chrome/browser/ui/android/context_menu_helper.h" | 56 #include "chrome/browser/ui/android/context_menu_helper.h" |
| 57 #include "chrome/browser/ui/android/window_android_helper.h" | 57 #include "chrome/browser/ui/android/window_android_helper.h" |
| 58 #else | 58 #else |
| 59 #include "chrome/browser/banners/app_banner_manager_desktop.h" | 59 #include "chrome/browser/banners/app_banner_manager_desktop.h" |
| 60 #include "chrome/browser/plugins/plugin_observer.h" | 60 #include "chrome/browser/plugins/plugin_observer.h" |
| 61 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 61 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
| 62 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" | 62 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" |
| 63 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 63 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| 64 #include "chrome/browser/ui/hung_plugin_tab_helper.h" | 64 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
| 65 #include "chrome/browser/ui/sad_tab_helper.h" | 65 #include "chrome/browser/ui/sad_tab_helper.h" |
| 66 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 66 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 67 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | 67 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" |
| 68 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 68 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 69 #include "components/pdf/browser/pdf_web_contents_helper.h" | 69 #include "components/pdf/browser/pdf_web_contents_helper.h" |
| 70 #include "components/ui/zoom/zoom_controller.h" | 70 #include "components/ui/zoom/zoom_controller.h" |
| 71 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 71 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 72 #endif // defined(OS_ANDROID) | 72 #endif // defined(ANDROID_JAVA_UI) |
| 73 | 73 |
| 74 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
| 75 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" | 75 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" |
| 76 #endif | 76 #endif |
| 77 | 77 |
| 78 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 78 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 79 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 79 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
| 80 #endif | 80 #endif |
| 81 | 81 |
| 82 #if defined(ENABLE_EXTENSIONS) | 82 #if defined(ENABLE_EXTENSIONS) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 #if defined(ENABLE_EXTENSIONS) | 124 #if defined(ENABLE_EXTENSIONS) |
| 125 // Set the view type. | 125 // Set the view type. |
| 126 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); | 126 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); |
| 127 #endif | 127 #endif |
| 128 | 128 |
| 129 // Create all the tab helpers. | 129 // Create all the tab helpers. |
| 130 | 130 |
| 131 // SessionTabHelper comes first because it sets up the tab ID, and other | 131 // SessionTabHelper comes first because it sets up the tab ID, and other |
| 132 // helpers may rely on that. | 132 // helpers may rely on that. |
| 133 SessionTabHelper::CreateForWebContents(web_contents); | 133 SessionTabHelper::CreateForWebContents(web_contents); |
| 134 #if !defined(OS_ANDROID) | 134 #if !defined(ANDROID_JAVA_UI) |
| 135 // ZoomController comes before common tab helpers since ChromeAutofillClient | 135 // ZoomController comes before common tab helpers since ChromeAutofillClient |
| 136 // may want to register as a ZoomObserver with it. | 136 // may want to register as a ZoomObserver with it. |
| 137 ui_zoom::ZoomController::CreateForWebContents(web_contents); | 137 ui_zoom::ZoomController::CreateForWebContents(web_contents); |
| 138 #endif | 138 #endif |
| 139 | 139 |
| 140 // --- Common tab helpers --- | 140 // --- Common tab helpers --- |
| 141 | 141 |
| 142 autofill::ChromeAutofillClient::CreateForWebContents(web_contents); | 142 autofill::ChromeAutofillClient::CreateForWebContents(web_contents); |
| 143 autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( | 143 autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( |
| 144 web_contents, | 144 web_contents, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 172 SearchTabHelper::CreateForWebContents(web_contents); | 172 SearchTabHelper::CreateForWebContents(web_contents); |
| 173 SecurityStateModel::CreateForWebContents(web_contents); | 173 SecurityStateModel::CreateForWebContents(web_contents); |
| 174 if (SiteEngagementService::IsEnabled()) | 174 if (SiteEngagementService::IsEnabled()) |
| 175 SiteEngagementHelper::CreateForWebContents(web_contents); | 175 SiteEngagementHelper::CreateForWebContents(web_contents); |
| 176 // TODO(vabr): Remove TabSpecificContentSettings from here once their function | 176 // TODO(vabr): Remove TabSpecificContentSettings from here once their function |
| 177 // is taken over by ChromeContentSettingsClient. http://crbug.com/387075 | 177 // is taken over by ChromeContentSettingsClient. http://crbug.com/387075 |
| 178 TabSpecificContentSettings::CreateForWebContents(web_contents); | 178 TabSpecificContentSettings::CreateForWebContents(web_contents); |
| 179 | 179 |
| 180 // --- Platform-specific tab helpers --- | 180 // --- Platform-specific tab helpers --- |
| 181 | 181 |
| 182 #if defined(OS_ANDROID) | 182 #if defined(ANDROID_JAVA_UI) |
| 183 ContextMenuHelper::CreateForWebContents(web_contents); | 183 ContextMenuHelper::CreateForWebContents(web_contents); |
| 184 DataUseTabHelper::CreateForWebContents(web_contents); | 184 DataUseTabHelper::CreateForWebContents(web_contents); |
| 185 SingleTabModeTabHelper::CreateForWebContents(web_contents); | 185 SingleTabModeTabHelper::CreateForWebContents(web_contents); |
| 186 VoiceSearchTabHelper::CreateForWebContents(web_contents); | 186 VoiceSearchTabHelper::CreateForWebContents(web_contents); |
| 187 WindowAndroidHelper::CreateForWebContents(web_contents); | 187 WindowAndroidHelper::CreateForWebContents(web_contents); |
| 188 #else | 188 #else |
| 189 BookmarkTabHelper::CreateForWebContents(web_contents); | 189 BookmarkTabHelper::CreateForWebContents(web_contents); |
| 190 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 190 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 191 web_contents); | 191 web_contents); |
| 192 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); | 192 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 251 |
| 252 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 252 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
| 253 web_contents->GetBrowserContext())) { | 253 web_contents->GetBrowserContext())) { |
| 254 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 254 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
| 255 web_contents); | 255 web_contents); |
| 256 } | 256 } |
| 257 | 257 |
| 258 if (tracing::NavigationTracingObserver::IsEnabled()) | 258 if (tracing::NavigationTracingObserver::IsEnabled()) |
| 259 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 259 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
| 260 } | 260 } |
| OLD | NEW |