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

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

Issue 2060313002: Navigation throttle for the Safe Browsing Subresource Filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pre-tab-activation
Patch Set: rebase && comments Created 4 years, 5 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 #include "components/google/core/browser/google_util.h" 125 #include "components/google/core/browser/google_util.h"
126 #include "components/metrics/client_info.h" 126 #include "components/metrics/client_info.h"
127 #include "components/net_log/chrome_net_log.h" 127 #include "components/net_log/chrome_net_log.h"
128 #include "components/pref_registry/pref_registry_syncable.h" 128 #include "components/pref_registry/pref_registry_syncable.h"
129 #include "components/prefs/pref_service.h" 129 #include "components/prefs/pref_service.h"
130 #include "components/prefs/scoped_user_pref_update.h" 130 #include "components/prefs/scoped_user_pref_update.h"
131 #include "components/rappor/rappor_utils.h" 131 #include "components/rappor/rappor_utils.h"
132 #include "components/security_interstitials/core/ssl_error_ui.h" 132 #include "components/security_interstitials/core/ssl_error_ui.h"
133 #include "components/signin/core/common/profile_management_switches.h" 133 #include "components/signin/core/common/profile_management_switches.h"
134 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h" 134 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h"
135 #include "components/subresource_filter/content/browser/subresource_filter_navig ation_throttle.h"
135 #include "components/translate/core/common/translate_switches.h" 136 #include "components/translate/core/common/translate_switches.h"
136 #include "components/url_formatter/url_fixer.h" 137 #include "components/url_formatter/url_fixer.h"
137 #include "components/variations/variations_associated_data.h" 138 #include "components/variations/variations_associated_data.h"
138 #include "components/version_info/version_info.h" 139 #include "components/version_info/version_info.h"
139 #include "content/public/browser/browser_child_process_host.h" 140 #include "content/public/browser/browser_child_process_host.h"
140 #include "content/public/browser/browser_main_parts.h" 141 #include "content/public/browser/browser_main_parts.h"
141 #include "content/public/browser/browser_ppapi_host.h" 142 #include "content/public/browser/browser_ppapi_host.h"
142 #include "content/public/browser/browser_thread.h" 143 #include "content/public/browser/browser_thread.h"
143 #include "content/public/browser/browser_url_handler.h" 144 #include "content/public/browser/browser_url_handler.h"
144 #include "content/public/browser/child_process_data.h" 145 #include "content/public/browser/child_process_data.h"
(...skipping 2762 matching lines...) Expand 10 before | Expand all | Expand 10 after
2907 throttles.push_back(MergeSessionNavigationThrottle::Create(handle)); 2908 throttles.push_back(MergeSessionNavigationThrottle::Create(handle));
2908 } 2909 }
2909 } 2910 }
2910 #endif 2911 #endif
2911 2912
2912 #if defined(ENABLE_EXTENSIONS) 2913 #if defined(ENABLE_EXTENSIONS)
2913 if (!handle->IsInMainFrame()) 2914 if (!handle->IsInMainFrame())
2914 throttles.push_back(new extensions::ExtensionNavigationThrottle(handle)); 2915 throttles.push_back(new extensions::ExtensionNavigationThrottle(handle));
2915 #endif 2916 #endif
2916 2917
2918 if (handle->IsInMainFrame() && handle->GetURL().SchemeIsHTTPOrHTTPS()) {
2919 // TODO(melandory): Activation logic should be moved to the
2920 // WebContentsObserver, once ReadyToCommitNavigation is available on
2921 // pre-PlzNavigate world (tracking bug: https://crbug.com/621856).
2922 throttles.push_back(
2923 subresource_filter::SubresourceFilterNavigationThrottle::Create(
2924 handle));
2925 }
2926
2917 return throttles; 2927 return throttles;
2918 } 2928 }
2919 2929
2920 content::DevToolsManagerDelegate* 2930 content::DevToolsManagerDelegate*
2921 ChromeContentBrowserClient::GetDevToolsManagerDelegate() { 2931 ChromeContentBrowserClient::GetDevToolsManagerDelegate() {
2922 return new ChromeDevToolsManagerDelegate(); 2932 return new ChromeDevToolsManagerDelegate();
2923 } 2933 }
2924 2934
2925 content::TracingDelegate* ChromeContentBrowserClient::GetTracingDelegate() { 2935 content::TracingDelegate* ChromeContentBrowserClient::GetTracingDelegate() {
2926 return new ChromeTracingDelegate(); 2936 return new ChromeTracingDelegate();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 if (channel <= kMaxDisableEncryptionChannel) { 2994 if (channel <= kMaxDisableEncryptionChannel) {
2985 static const char* const kWebRtcDevSwitchNames[] = { 2995 static const char* const kWebRtcDevSwitchNames[] = {
2986 switches::kDisableWebRtcEncryption, 2996 switches::kDisableWebRtcEncryption,
2987 }; 2997 };
2988 to_command_line->CopySwitchesFrom(from_command_line, 2998 to_command_line->CopySwitchesFrom(from_command_line,
2989 kWebRtcDevSwitchNames, 2999 kWebRtcDevSwitchNames,
2990 arraysize(kWebRtcDevSwitchNames)); 3000 arraysize(kWebRtcDevSwitchNames));
2991 } 3001 }
2992 } 3002 }
2993 #endif // defined(ENABLE_WEBRTC) 3003 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698