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

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: engedy review 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
« no previous file with comments | « no previous file | chrome/browser/subresource_filter/chrome_subresource_filter_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3304 matching lines...) Expand 10 before | Expand all | Expand 10 after
3464 throttles.push_back(std::move(delay_navigation_throttle)); 3466 throttles.push_back(std::move(delay_navigation_throttle));
3465 3467
3466 content::NavigationThrottle* subresource_filter_activation_throttle = 3468 content::NavigationThrottle* subresource_filter_activation_throttle =
3467 MaybeCreateSubresourceFilterNavigationThrottle( 3469 MaybeCreateSubresourceFilterNavigationThrottle(
3468 handle, g_browser_process->safe_browsing_service()); 3470 handle, g_browser_process->safe_browsing_service());
3469 if (subresource_filter_activation_throttle) { 3471 if (subresource_filter_activation_throttle) {
3470 throttles.push_back( 3472 throttles.push_back(
3471 base::WrapUnique(subresource_filter_activation_throttle)); 3473 base::WrapUnique(subresource_filter_activation_throttle));
3472 } 3474 }
3473 3475
3476 // These throttles must come after the
3477 // SubresourceFilterSafeBrowsingActivationThrottle.
3478 content::WebContents* web_contents = handle->GetWebContents();
3479 if (auto* factory =
3480 subresource_filter::ContentSubresourceFilterDriverFactory::
3481 FromWebContents(web_contents)) {
3482 factory->throttle_manager()->MaybeAppendNavigationThrottles(handle,
3483 &throttles);
3484 }
3485
3474 return throttles; 3486 return throttles;
3475 } 3487 }
3476 3488
3477 std::unique_ptr<content::NavigationUIData> 3489 std::unique_ptr<content::NavigationUIData>
3478 ChromeContentBrowserClient::GetNavigationUIData( 3490 ChromeContentBrowserClient::GetNavigationUIData(
3479 content::NavigationHandle* navigation_handle) { 3491 content::NavigationHandle* navigation_handle) {
3480 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle); 3492 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle);
3481 } 3493 }
3482 3494
3483 content::DevToolsManagerDelegate* 3495 content::DevToolsManagerDelegate*
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
3608 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3620 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3609 return variations::GetVariationParamValue( 3621 return variations::GetVariationParamValue(
3610 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3622 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3611 } 3623 }
3612 3624
3613 // static 3625 // static
3614 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3626 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3615 const storage::QuotaSettings* settings) { 3627 const storage::QuotaSettings* settings) {
3616 g_default_quota_settings = settings; 3628 g_default_quota_settings = settings;
3617 } 3629 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/subresource_filter/chrome_subresource_filter_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698