OLD | NEW |
---|---|
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 Loading... | |
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 3297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3457 throttles.push_back(std::move(delay_navigation_throttle)); | 3459 throttles.push_back(std::move(delay_navigation_throttle)); |
3458 | 3460 |
3459 content::NavigationThrottle* subresource_filter_activation_throttle = | 3461 content::NavigationThrottle* subresource_filter_activation_throttle = |
3460 MaybeCreateSubresourceFilterNavigationThrottle( | 3462 MaybeCreateSubresourceFilterNavigationThrottle( |
3461 handle, g_browser_process->safe_browsing_service()); | 3463 handle, g_browser_process->safe_browsing_service()); |
3462 if (subresource_filter_activation_throttle) { | 3464 if (subresource_filter_activation_throttle) { |
3463 throttles.push_back( | 3465 throttles.push_back( |
3464 base::WrapUnique(subresource_filter_activation_throttle)); | 3466 base::WrapUnique(subresource_filter_activation_throttle)); |
3465 } | 3467 } |
3466 | 3468 |
3469 // These throttles must come after the | |
3470 // SubresourceFilterSafeBrowsingActivationThrottle. | |
3471 content::WebContents* web_contents = handle->GetWebContents(); | |
3472 if (auto* factory = | |
engedy
2017/04/04 11:36:52
nit: Can this ever be nullptr?
Charlie Harrison
2017/04/04 15:54:00
I'm pretty sure it can. Embedders of WebContents a
engedy
2017/04/04 17:59:56
Ah, yes, you are right.
| |
3473 subresource_filter::ContentSubresourceFilterDriverFactory:: | |
3474 FromWebContents(web_contents)) { | |
3475 factory->throttle_manager()->MaybeAppendNavigationThrottles(handle, | |
3476 &throttles); | |
3477 } | |
3478 | |
3467 return throttles; | 3479 return throttles; |
3468 } | 3480 } |
3469 | 3481 |
3470 std::unique_ptr<content::NavigationUIData> | 3482 std::unique_ptr<content::NavigationUIData> |
3471 ChromeContentBrowserClient::GetNavigationUIData( | 3483 ChromeContentBrowserClient::GetNavigationUIData( |
3472 content::NavigationHandle* navigation_handle) { | 3484 content::NavigationHandle* navigation_handle) { |
3473 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle); | 3485 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle); |
3474 } | 3486 } |
3475 | 3487 |
3476 content::DevToolsManagerDelegate* | 3488 content::DevToolsManagerDelegate* |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3601 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3613 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3602 return variations::GetVariationParamValue( | 3614 return variations::GetVariationParamValue( |
3603 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3615 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3604 } | 3616 } |
3605 | 3617 |
3606 // static | 3618 // static |
3607 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3619 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
3608 const storage::QuotaSettings* settings) { | 3620 const storage::QuotaSettings* settings) { |
3609 g_default_quota_settings = settings; | 3621 g_default_quota_settings = settings; |
3610 } | 3622 } |
OLD | NEW |