Chromium Code Reviews| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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) |
| 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 #include "components/page_load_metrics/browser/page_load_metrics_web_contents_ob server.h" | |
| 56 #else | 57 #else |
| 57 #include "chrome/browser/banners/app_banner_manager_desktop.h" | 58 #include "chrome/browser/banners/app_banner_manager_desktop.h" |
| 58 #include "chrome/browser/plugins/plugin_observer.h" | 59 #include "chrome/browser/plugins/plugin_observer.h" |
| 59 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 60 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
| 60 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" | 61 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" |
| 61 #include "chrome/browser/ui/hung_plugin_tab_helper.h" | 62 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
| 62 #include "chrome/browser/ui/sad_tab_helper.h" | 63 #include "chrome/browser/ui/sad_tab_helper.h" |
| 63 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 64 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 64 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | 65 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" |
| 65 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" | 66 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 | 175 |
| 175 // --- Platform-specific tab helpers --- | 176 // --- Platform-specific tab helpers --- |
| 176 | 177 |
| 177 #if defined(OS_ANDROID) | 178 #if defined(OS_ANDROID) |
| 178 ContextMenuHelper::CreateForWebContents(web_contents); | 179 ContextMenuHelper::CreateForWebContents(web_contents); |
| 179 offline_pages::OfflinePageWebContentsObserver::CreateForWebContents( | 180 offline_pages::OfflinePageWebContentsObserver::CreateForWebContents( |
| 180 web_contents); | 181 web_contents); |
| 181 SingleTabModeTabHelper::CreateForWebContents(web_contents); | 182 SingleTabModeTabHelper::CreateForWebContents(web_contents); |
| 182 VoiceSearchTabHelper::CreateForWebContents(web_contents); | 183 VoiceSearchTabHelper::CreateForWebContents(web_contents); |
| 183 WindowAndroidHelper::CreateForWebContents(web_contents); | 184 WindowAndroidHelper::CreateForWebContents(web_contents); |
| 185 | |
| 186 // TODO(bmcquade): run on all platforms once crbug.com/521010 is resolved. | |
|
Randy Smith (Not in Mondays)
2015/08/17 19:31:07
I'm not sure which way I feel is better architectu
Bryan McQuade
2015/08/25 13:53:35
Turns out we can address this issue in the browser
| |
| 187 page_load_metrics::PageLoadMetricsWebContentsObserver::CreateForWebContents( | |
| 188 web_contents); | |
| 184 #else | 189 #else |
| 185 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 190 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 186 web_contents); | 191 web_contents); |
| 187 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); | 192 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); |
| 188 HungPluginTabHelper::CreateForWebContents(web_contents); | 193 HungPluginTabHelper::CreateForWebContents(web_contents); |
| 189 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( | 194 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( |
| 190 web_contents, | 195 web_contents, |
| 191 scoped_ptr<pdf::PDFWebContentsHelperClient>( | 196 scoped_ptr<pdf::PDFWebContentsHelperClient>( |
| 192 new ChromePDFWebContentsHelperClient())); | 197 new ChromePDFWebContentsHelperClient())); |
| 193 PermissionBubbleManager::CreateForWebContents(web_contents); | 198 PermissionBubbleManager::CreateForWebContents(web_contents); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 web_contents); | 249 web_contents); |
| 245 } | 250 } |
| 246 | 251 |
| 247 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 252 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 248 switches::kEnableNavigationTracing) && | 253 switches::kEnableNavigationTracing) && |
| 249 base::CommandLine::ForCurrentProcess()->HasSwitch( | 254 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 250 switches::kTraceUploadURL)) { | 255 switches::kTraceUploadURL)) { |
| 251 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 256 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
| 252 } | 257 } |
| 253 } | 258 } |
| OLD | NEW |