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

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

Issue 2446503002: Fix SubResourceFilter to work with PlzNavigate. (Closed)
Patch Set: fix unit tests Created 4 years, 1 month 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 #include "components/net_log/chrome_net_log.h" 132 #include "components/net_log/chrome_net_log.h"
133 #include "components/password_manager/content/browser/content_password_manager_d river_factory.h" 133 #include "components/password_manager/content/browser/content_password_manager_d river_factory.h"
134 #include "components/pref_registry/pref_registry_syncable.h" 134 #include "components/pref_registry/pref_registry_syncable.h"
135 #include "components/prefs/pref_service.h" 135 #include "components/prefs/pref_service.h"
136 #include "components/prefs/scoped_user_pref_update.h" 136 #include "components/prefs/scoped_user_pref_update.h"
137 #include "components/rappor/rappor_recorder_impl.h" 137 #include "components/rappor/rappor_recorder_impl.h"
138 #include "components/rappor/rappor_utils.h" 138 #include "components/rappor/rappor_utils.h"
139 #include "components/security_interstitials/core/ssl_error_ui.h" 139 #include "components/security_interstitials/core/ssl_error_ui.h"
140 #include "components/signin/core/common/profile_management_switches.h" 140 #include "components/signin/core/common/profile_management_switches.h"
141 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h" 141 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h"
142 #include "components/subresource_filter/content/browser/content_subresource_filt er_driver_factory.h"
143 #include "components/subresource_filter/content/browser/subresource_filter_navig ation_throttle.h"
144 #include "components/translate/core/common/translate_switches.h" 142 #include "components/translate/core/common/translate_switches.h"
145 #include "components/url_formatter/url_fixer.h" 143 #include "components/url_formatter/url_fixer.h"
146 #include "components/variations/variations_associated_data.h" 144 #include "components/variations/variations_associated_data.h"
147 #include "components/version_info/version_info.h" 145 #include "components/version_info/version_info.h"
148 #include "content/public/browser/browser_child_process_host.h" 146 #include "content/public/browser/browser_child_process_host.h"
149 #include "content/public/browser/browser_main_parts.h" 147 #include "content/public/browser/browser_main_parts.h"
150 #include "content/public/browser/browser_ppapi_host.h" 148 #include "content/public/browser/browser_ppapi_host.h"
151 #include "content/public/browser/browser_thread.h" 149 #include "content/public/browser/browser_thread.h"
152 #include "content/public/browser/browser_url_handler.h" 150 #include "content/public/browser/browser_url_handler.h"
153 #include "content/public/browser/child_process_data.h" 151 #include "content/public/browser/child_process_data.h"
(...skipping 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after
3142 throttles.push_back(std::move(url_to_arc_throttle)); 3140 throttles.push_back(std::move(url_to_arc_throttle));
3143 } 3141 }
3144 } 3142 }
3145 } 3143 }
3146 #endif 3144 #endif
3147 3145
3148 #if defined(ENABLE_EXTENSIONS) 3146 #if defined(ENABLE_EXTENSIONS)
3149 throttles.push_back(new extensions::ExtensionNavigationThrottle(handle)); 3147 throttles.push_back(new extensions::ExtensionNavigationThrottle(handle));
3150 #endif 3148 #endif
3151 3149
3152 subresource_filter::ContentSubresourceFilterDriverFactory*
3153 subresource_filter_driver_factory =
3154 subresource_filter::ContentSubresourceFilterDriverFactory::
3155 FromWebContents(handle->GetWebContents());
3156 if (subresource_filter_driver_factory && handle->IsInMainFrame() &&
3157 handle->GetURL().SchemeIsHTTPOrHTTPS()) {
3158 // TODO(melandory): Activation logic should be moved to the
3159 // WebContentsObserver, once ReadyToCommitNavigation is available on
3160 // pre-PlzNavigate world (tracking bug: https://crbug.com/621856).
3161 throttles.push_back(
3162 subresource_filter::SubresourceFilterNavigationThrottle::Create(
3163 handle));
3164 }
3165
3166 return throttles; 3150 return throttles;
3167 } 3151 }
3168 3152
3169 std::unique_ptr<content::NavigationUIData> 3153 std::unique_ptr<content::NavigationUIData>
3170 ChromeContentBrowserClient::GetNavigationUIData( 3154 ChromeContentBrowserClient::GetNavigationUIData(
3171 content::NavigationHandle* navigation_handle) { 3155 content::NavigationHandle* navigation_handle) {
3172 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle); 3156 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle);
3173 } 3157 }
3174 3158
3175 content::DevToolsManagerDelegate* 3159 content::DevToolsManagerDelegate*
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
3247 kWebRtcDevSwitchNames, 3231 kWebRtcDevSwitchNames,
3248 arraysize(kWebRtcDevSwitchNames)); 3232 arraysize(kWebRtcDevSwitchNames));
3249 } 3233 }
3250 } 3234 }
3251 #endif // defined(ENABLE_WEBRTC) 3235 #endif // defined(ENABLE_WEBRTC)
3252 3236
3253 std::unique_ptr<content::MemoryCoordinatorDelegate> 3237 std::unique_ptr<content::MemoryCoordinatorDelegate>
3254 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { 3238 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() {
3255 return memory::ChromeMemoryCoordinatorDelegate::Create(); 3239 return memory::ChromeMemoryCoordinatorDelegate::Create();
3256 } 3240 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698