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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 #include "chrome/browser/net/predictor_tab_helper.h" | 25 #include "chrome/browser/net/predictor_tab_helper.h" |
| 26 #include "chrome/browser/ntp_snippets/bookmark_last_visit_updater.h" | 26 #include "chrome/browser/ntp_snippets/bookmark_last_visit_updater.h" |
| 27 #include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h" | 27 #include "chrome/browser/page_load_metrics/page_load_metrics_initialize.h" |
| 28 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 28 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 29 #include "chrome/browser/permissions/permission_request_manager.h" | 29 #include "chrome/browser/permissions/permission_request_manager.h" |
| 30 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 30 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 31 #include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h" | 31 #include "chrome/browser/predictors/resource_prefetch_predictor_tab_helper.h" |
| 32 #include "chrome/browser/prerender/prerender_tab_helper.h" | 32 #include "chrome/browser/prerender/prerender_tab_helper.h" |
| 33 #include "chrome/browser/previews/previews_infobar_tab_helper.h" | 33 #include "chrome/browser/previews/previews_infobar_tab_helper.h" |
| 34 #include "chrome/browser/profiles/profile.h" | 34 #include "chrome/browser/profiles/profile.h" |
| 35 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | |
| 35 #include "chrome/browser/sessions/session_tab_helper.h" | 36 #include "chrome/browser/sessions/session_tab_helper.h" |
| 36 #include "chrome/browser/ssl/security_state_tab_helper.h" | 37 #include "chrome/browser/ssl/security_state_tab_helper.h" |
| 37 #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" | 38 #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" |
| 38 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" | 39 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
| 39 #include "chrome/browser/tracing/navigation_tracing.h" | 40 #include "chrome/browser/tracing/navigation_tracing.h" |
| 40 #include "chrome/browser/translate/chrome_translate_client.h" | 41 #include "chrome/browser/translate/chrome_translate_client.h" |
| 41 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 42 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
| 42 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 43 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| 43 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 44 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 44 #include "chrome/browser/ui/navigation_correction_tab_observer.h" | 45 #include "chrome/browser/ui/navigation_correction_tab_observer.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 70 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" | 71 #include "chrome/browser/android/offline_pages/offline_page_tab_helper.h" |
| 71 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" | 72 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" |
| 72 #include "chrome/browser/android/search_geolocation_disclosure_tab_helper.h" | 73 #include "chrome/browser/android/search_geolocation_disclosure_tab_helper.h" |
| 73 #include "chrome/browser/android/voice_search_tab_helper.h" | 74 #include "chrome/browser/android/voice_search_tab_helper.h" |
| 74 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 75 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
| 75 #include "chrome/browser/ui/android/context_menu_helper.h" | 76 #include "chrome/browser/ui/android/context_menu_helper.h" |
| 76 #include "chrome/browser/ui/android/view_android_helper.h" | 77 #include "chrome/browser/ui/android/view_android_helper.h" |
| 77 #else | 78 #else |
| 78 #include "chrome/browser/banners/app_banner_manager_desktop.h" | 79 #include "chrome/browser/banners/app_banner_manager_desktop.h" |
| 79 #include "chrome/browser/plugins/plugin_observer.h" | 80 #include "chrome/browser/plugins/plugin_observer.h" |
| 81 #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer.h" | |
| 82 #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager .h" | |
| 80 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 83 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
| 81 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" | 84 #include "chrome/browser/thumbnails/thumbnail_tab_helper.h" |
| 82 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 85 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| 83 #include "chrome/browser/ui/hung_plugin_tab_helper.h" | 86 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
| 84 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h" | 87 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h" |
| 85 #include "chrome/browser/ui/sad_tab_helper.h" | 88 #include "chrome/browser/ui/sad_tab_helper.h" |
| 86 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | 89 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" |
| 87 #include "components/pdf/browser/pdf_web_contents_helper.h" | 90 #include "components/pdf/browser/pdf_web_contents_helper.h" |
| 88 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 91 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 89 #include "components/zoom/zoom_controller.h" | 92 #include "components/zoom/zoom_controller.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); | 224 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); |
| 222 HungPluginTabHelper::CreateForWebContents(web_contents); | 225 HungPluginTabHelper::CreateForWebContents(web_contents); |
| 223 JavaScriptDialogTabHelper::CreateForWebContents(web_contents); | 226 JavaScriptDialogTabHelper::CreateForWebContents(web_contents); |
| 224 ManagePasswordsUIController::CreateForWebContents(web_contents); | 227 ManagePasswordsUIController::CreateForWebContents(web_contents); |
| 225 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( | 228 pdf::PDFWebContentsHelper::CreateForWebContentsWithClient( |
| 226 web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( | 229 web_contents, std::unique_ptr<pdf::PDFWebContentsHelperClient>( |
| 227 new ChromePDFWebContentsHelperClient())); | 230 new ChromePDFWebContentsHelperClient())); |
| 228 PluginObserver::CreateForWebContents(web_contents); | 231 PluginObserver::CreateForWebContents(web_contents); |
| 229 SadTabHelper::CreateForWebContents(web_contents); | 232 SadTabHelper::CreateForWebContents(web_contents); |
| 230 safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents); | 233 safe_browsing::SafeBrowsingTabObserver::CreateForWebContents(web_contents); |
| 234 if (safe_browsing::SafeBrowsingNavigationObserverManager::IsEnabledAndReady( | |
|
Nathan Parker
2016/12/20 01:01:33
Would it be tidier to keep all this logic in the n
Jialiu Lin
2016/12/20 02:07:51
You're right. Move all the checkings to SafeBrowsi
| |
| 235 Profile::FromBrowserContext(web_contents->GetBrowserContext()))) { | |
| 236 safe_browsing::SafeBrowsingNavigationObserver::CreateForWebContents( | |
| 237 web_contents, | |
| 238 g_browser_process->safe_browsing_service() | |
| 239 ->navigation_observer_manager()); | |
| 240 } | |
| 231 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); | 241 TabContentsSyncedTabDelegate::CreateForWebContents(web_contents); |
| 232 TabDialogs::CreateForWebContents(web_contents); | 242 TabDialogs::CreateForWebContents(web_contents); |
| 233 ThumbnailTabHelper::CreateForWebContents(web_contents); | 243 ThumbnailTabHelper::CreateForWebContents(web_contents); |
| 234 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); | 244 web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents); |
| 235 | 245 |
| 236 if (banners::AppBannerManagerDesktop::IsEnabled()) | 246 if (banners::AppBannerManagerDesktop::IsEnabled()) |
| 237 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); | 247 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); |
| 238 #endif | 248 #endif |
| 239 | 249 |
| 240 #if defined(OS_WIN) || defined(OS_MACOSX) || \ | 250 #if defined(OS_WIN) || defined(OS_MACOSX) || \ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 | 283 |
| 274 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( | 284 if (predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
| 275 web_contents->GetBrowserContext())) { | 285 web_contents->GetBrowserContext())) { |
| 276 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( | 286 predictors::ResourcePrefetchPredictorTabHelper::CreateForWebContents( |
| 277 web_contents); | 287 web_contents); |
| 278 } | 288 } |
| 279 | 289 |
| 280 if (tracing::NavigationTracingObserver::IsEnabled()) | 290 if (tracing::NavigationTracingObserver::IsEnabled()) |
| 281 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); | 291 tracing::NavigationTracingObserver::CreateForWebContents(web_contents); |
| 282 } | 292 } |
| OLD | NEW |