Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2858483003: [subresource_filter] Move throttle insertion into the client (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #include "chrome/browser/search/instant_service.h" 77 #include "chrome/browser/search/instant_service.h"
78 #include "chrome/browser/search/instant_service_factory.h" 78 #include "chrome/browser/search/instant_service_factory.h"
79 #include "chrome/browser/search/search.h" 79 #include "chrome/browser/search/search.h"
80 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" 80 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h"
81 #include "chrome/browser/speech/tts_controller.h" 81 #include "chrome/browser/speech/tts_controller.h"
82 #include "chrome/browser/speech/tts_message_filter.h" 82 #include "chrome/browser/speech/tts_message_filter.h"
83 #include "chrome/browser/ssl/ssl_blocking_page.h" 83 #include "chrome/browser/ssl/ssl_blocking_page.h"
84 #include "chrome/browser/ssl/ssl_cert_reporter.h" 84 #include "chrome/browser/ssl/ssl_cert_reporter.h"
85 #include "chrome/browser/ssl/ssl_client_certificate_selector.h" 85 #include "chrome/browser/ssl/ssl_client_certificate_selector.h"
86 #include "chrome/browser/ssl/ssl_error_handler.h" 86 #include "chrome/browser/ssl/ssl_error_handler.h"
87 #include "chrome/browser/subresource_filter/navigation_throttle_util.h" 87 #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h"
88 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h" 88 #include "chrome/browser/sync_file_system/local/sync_file_system_backend.h"
89 #include "chrome/browser/tab_contents/tab_util.h" 89 #include "chrome/browser/tab_contents/tab_util.h"
90 #include "chrome/browser/tracing/chrome_tracing_delegate.h" 90 #include "chrome/browser/tracing/chrome_tracing_delegate.h"
91 #include "chrome/browser/translate/chrome_translate_client.h" 91 #include "chrome/browser/translate/chrome_translate_client.h"
92 #include "chrome/browser/ui/blocked_content/blocked_window_params.h" 92 #include "chrome/browser/ui/blocked_content/blocked_window_params.h"
93 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" 93 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h"
94 #include "chrome/browser/ui/browser_navigator.h" 94 #include "chrome/browser/ui/browser_navigator.h"
95 #include "chrome/browser/ui/browser_navigator_params.h" 95 #include "chrome/browser/ui/browser_navigator_params.h"
96 #include "chrome/browser/ui/chrome_select_file_policy.h" 96 #include "chrome/browser/ui/chrome_select_file_policy.h"
97 #include "chrome/browser/ui/sync/sync_promo_ui.h" 97 #include "chrome/browser/ui/sync/sync_promo_ui.h"
(...skipping 3380 matching lines...) Expand 10 before | Expand all | Expand 10 after
3478 SupervisedUserGoogleAuthNavigationThrottle::MaybeCreate(handle); 3478 SupervisedUserGoogleAuthNavigationThrottle::MaybeCreate(handle);
3479 if (supervised_user_nav_throttle) 3479 if (supervised_user_nav_throttle)
3480 throttles.push_back(std::move(supervised_user_nav_throttle)); 3480 throttles.push_back(std::move(supervised_user_nav_throttle));
3481 #endif 3481 #endif
3482 3482
3483 std::unique_ptr<content::NavigationThrottle> delay_navigation_throttle = 3483 std::unique_ptr<content::NavigationThrottle> delay_navigation_throttle =
3484 DelayNavigationThrottle::MaybeCreateThrottleFor(handle); 3484 DelayNavigationThrottle::MaybeCreateThrottleFor(handle);
3485 if (delay_navigation_throttle) 3485 if (delay_navigation_throttle)
3486 throttles.push_back(std::move(delay_navigation_throttle)); 3486 throttles.push_back(std::move(delay_navigation_throttle));
3487 3487
3488 content::NavigationThrottle* subresource_filter_activation_throttle =
3489 MaybeCreateSubresourceFilterNavigationThrottle(
3490 handle, g_browser_process->safe_browsing_service());
3491 if (subresource_filter_activation_throttle) {
3492 throttles.push_back(
3493 base::WrapUnique(subresource_filter_activation_throttle));
3494 }
3495
3496 // These throttles must come after the
3497 // SubresourceFilterSafeBrowsingActivationThrottle.
3498 content::WebContents* web_contents = handle->GetWebContents(); 3488 content::WebContents* web_contents = handle->GetWebContents();
3499 if (auto* factory = 3489 if (auto* subresource_filter_client =
3500 subresource_filter::ContentSubresourceFilterDriverFactory:: 3490 ChromeSubresourceFilterClient::FromWebContents(web_contents)) {
3501 FromWebContents(web_contents)) { 3491 subresource_filter_client->MaybeAppendNavigationThrottles(handle,
3502 factory->throttle_manager()->MaybeAppendNavigationThrottles(handle, 3492 &throttles);
3503 &throttles);
3504 } 3493 }
3505 3494
3506 return throttles; 3495 return throttles;
3507 } 3496 }
3508 3497
3509 std::unique_ptr<content::NavigationUIData> 3498 std::unique_ptr<content::NavigationUIData>
3510 ChromeContentBrowserClient::GetNavigationUIData( 3499 ChromeContentBrowserClient::GetNavigationUIData(
3511 content::NavigationHandle* navigation_handle) { 3500 content::NavigationHandle* navigation_handle) {
3512 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle); 3501 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle);
3513 } 3502 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
3624 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3613 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3625 return variations::GetVariationParamValue( 3614 return variations::GetVariationParamValue(
3626 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3615 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3627 } 3616 }
3628 3617
3629 // static 3618 // static
3630 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3619 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3631 const storage::QuotaSettings* settings) { 3620 const storage::QuotaSettings* settings) {
3632 g_default_quota_settings = settings; 3621 g_default_quota_settings = settings;
3633 } 3622 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698