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

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

Issue 2762403002: Wire up the ThrottleManager using the existing page activation logic (Closed)
Patch Set: small tweaks Created 3 years, 8 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 #include "components/prefs/pref_service.h" 140 #include "components/prefs/pref_service.h"
141 #include "components/prefs/scoped_user_pref_update.h" 141 #include "components/prefs/scoped_user_pref_update.h"
142 #include "components/rappor/public/rappor_utils.h" 142 #include "components/rappor/public/rappor_utils.h"
143 #include "components/rappor/rappor_recorder_impl.h" 143 #include "components/rappor/rappor_recorder_impl.h"
144 #include "components/rappor/rappor_service_impl.h" 144 #include "components/rappor/rappor_service_impl.h"
145 #include "components/safe_browsing_db/safe_browsing_prefs.h" 145 #include "components/safe_browsing_db/safe_browsing_prefs.h"
146 #include "components/security_interstitials/core/ssl_error_ui.h" 146 #include "components/security_interstitials/core/ssl_error_ui.h"
147 #include "components/signin/core/common/profile_management_switches.h" 147 #include "components/signin/core/common/profile_management_switches.h"
148 #include "components/spellcheck/spellcheck_build_features.h" 148 #include "components/spellcheck/spellcheck_build_features.h"
149 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h" 149 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h"
150 #include "components/subresource_filter/content/browser/content_subresource_filt er_driver_factory.h"
151 #include "components/subresource_filter/content/browser/content_subresource_filt er_throttle_manager.h"
150 #include "components/task_scheduler_util/browser/initialization.h" 152 #include "components/task_scheduler_util/browser/initialization.h"
151 #include "components/task_scheduler_util/common/variations_util.h" 153 #include "components/task_scheduler_util/common/variations_util.h"
152 #include "components/translate/core/common/translate_switches.h" 154 #include "components/translate/core/common/translate_switches.h"
153 #include "components/url_formatter/url_fixer.h" 155 #include "components/url_formatter/url_fixer.h"
154 #include "components/variations/variations_associated_data.h" 156 #include "components/variations/variations_associated_data.h"
155 #include "components/version_info/version_info.h" 157 #include "components/version_info/version_info.h"
156 #include "content/public/browser/browser_child_process_host.h" 158 #include "content/public/browser/browser_child_process_host.h"
157 #include "content/public/browser/browser_main_parts.h" 159 #include "content/public/browser/browser_main_parts.h"
158 #include "content/public/browser/browser_ppapi_host.h" 160 #include "content/public/browser/browser_ppapi_host.h"
159 #include "content/public/browser/browser_thread.h" 161 #include "content/public/browser/browser_thread.h"
(...skipping 3286 matching lines...) Expand 10 before | Expand all | Expand 10 after
3446 throttles.push_back(std::move(delay_navigation_throttle)); 3448 throttles.push_back(std::move(delay_navigation_throttle));
3447 3449
3448 content::NavigationThrottle* subresource_filter_activation_throttle = 3450 content::NavigationThrottle* subresource_filter_activation_throttle =
3449 MaybeCreateSubresourceFilterNavigationThrottle( 3451 MaybeCreateSubresourceFilterNavigationThrottle(
3450 handle, g_browser_process->safe_browsing_service()); 3452 handle, g_browser_process->safe_browsing_service());
3451 if (subresource_filter_activation_throttle) { 3453 if (subresource_filter_activation_throttle) {
3452 throttles.push_back( 3454 throttles.push_back(
3453 base::WrapUnique(subresource_filter_activation_throttle)); 3455 base::WrapUnique(subresource_filter_activation_throttle));
3454 } 3456 }
3455 3457
3458 // These throttles must come after the SubresourceFilterNavigationThrottle.
pkalinnikov 2017/04/03 13:40:07 nit: Should this be SubresourceFilterSafeBrowsingA
Charlie Harrison 2017/04/03 15:33:31 Yes, done. Let me fix the naming of the function i
3459 content::WebContents* web_contents = handle->GetWebContents();
3460 if (auto* factory =
3461 subresource_filter::ContentSubresourceFilterDriverFactory::
3462 FromWebContents(web_contents)) {
3463 factory->throttle_manager()->MaybeAppendNavigationThrottles(handle,
3464 &throttles);
3465 }
3466
3456 return throttles; 3467 return throttles;
3457 } 3468 }
3458 3469
3459 std::unique_ptr<content::NavigationUIData> 3470 std::unique_ptr<content::NavigationUIData>
3460 ChromeContentBrowserClient::GetNavigationUIData( 3471 ChromeContentBrowserClient::GetNavigationUIData(
3461 content::NavigationHandle* navigation_handle) { 3472 content::NavigationHandle* navigation_handle) {
3462 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle); 3473 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle);
3463 } 3474 }
3464 3475
3465 content::DevToolsManagerDelegate* 3476 content::DevToolsManagerDelegate*
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
3590 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3601 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3591 return variations::GetVariationParamValue( 3602 return variations::GetVariationParamValue(
3592 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3603 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3593 } 3604 }
3594 3605
3595 // static 3606 // static
3596 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3607 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3597 const storage::QuotaSettings* settings) { 3608 const storage::QuotaSettings* settings) {
3598 g_default_quota_settings = settings; 3609 g_default_quota_settings = settings;
3599 } 3610 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698