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

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

Issue 2272123002: [HBD] Intercept navigation to Flash download page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per Lei Zhang's comments Created 4 years, 3 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 | « chrome/browser/BUILD.gn ('k') | chrome/browser/plugins/flash_download_interception.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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 #include "extensions/common/extension_set.h" 295 #include "extensions/common/extension_set.h"
296 #include "extensions/common/manifest_handlers/background_info.h" 296 #include "extensions/common/manifest_handlers/background_info.h"
297 #include "extensions/common/manifest_handlers/shared_module_info.h" 297 #include "extensions/common/manifest_handlers/shared_module_info.h"
298 #include "extensions/common/permissions/permissions_data.h" 298 #include "extensions/common/permissions/permissions_data.h"
299 #include "extensions/common/permissions/socket_permission.h" 299 #include "extensions/common/permissions/socket_permission.h"
300 #include "extensions/common/switches.h" 300 #include "extensions/common/switches.h"
301 #endif 301 #endif
302 302
303 #if defined(ENABLE_PLUGINS) 303 #if defined(ENABLE_PLUGINS)
304 #include "chrome/browser/plugins/chrome_content_browser_client_plugins_part.h" 304 #include "chrome/browser/plugins/chrome_content_browser_client_plugins_part.h"
305 #include "chrome/browser/plugins/flash_download_interception.h"
305 #endif 306 #endif
306 307
307 #if defined(ENABLE_SPELLCHECK) 308 #if defined(ENABLE_SPELLCHECK)
308 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" 309 #include "chrome/browser/spellchecker/spellcheck_message_filter.h"
309 #endif 310 #endif
310 311
311 #if defined(USE_BROWSER_SPELLCHECKER) 312 #if defined(USE_BROWSER_SPELLCHECKER)
312 #include "components/spellcheck/browser/spellcheck_message_filter_platform.h" 313 #include "components/spellcheck/browser/spellcheck_message_filter_platform.h"
313 #endif 314 #endif
314 315
(...skipping 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 if (url.is_valid()) { 2997 if (url.is_valid()) {
2997 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), 2998 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
2998 metric, url); 2999 metric, url);
2999 } 3000 }
3000 } 3001 }
3001 3002
3002 ScopedVector<content::NavigationThrottle> 3003 ScopedVector<content::NavigationThrottle>
3003 ChromeContentBrowserClient::CreateThrottlesForNavigation( 3004 ChromeContentBrowserClient::CreateThrottlesForNavigation(
3004 content::NavigationHandle* handle) { 3005 content::NavigationHandle* handle) {
3005 ScopedVector<content::NavigationThrottle> throttles; 3006 ScopedVector<content::NavigationThrottle> throttles;
3007
3006 if (handle->IsInMainFrame()) { 3008 if (handle->IsInMainFrame()) {
3009 #if defined(ENABLE_PLUGINS)
3010 std::unique_ptr<content::NavigationThrottle> flash_url_throttle =
3011 FlashDownloadInterception::MaybeCreateThrottleFor(handle);
3012 if (flash_url_throttle)
3013 throttles.push_back(std::move(flash_url_throttle));
3014 #endif
3015
3007 throttles.push_back( 3016 throttles.push_back(
3008 page_load_metrics::MetricsNavigationThrottle::Create(handle)); 3017 page_load_metrics::MetricsNavigationThrottle::Create(handle));
3009 } 3018 }
3010 3019
3011 #if defined(OS_ANDROID) 3020 #if defined(OS_ANDROID)
3012 // TODO(davidben): This is insufficient to integrate with prerender properly. 3021 // TODO(davidben): This is insufficient to integrate with prerender properly.
3013 // https://crbug.com/370595 3022 // https://crbug.com/370595
3014 prerender::PrerenderContents* prerender_contents = 3023 prerender::PrerenderContents* prerender_contents =
3015 prerender::PrerenderContents::FromWebContents(handle->GetWebContents()); 3024 prerender::PrerenderContents::FromWebContents(handle->GetWebContents());
3016 if (!prerender_contents && handle->IsInMainFrame()) { 3025 if (!prerender_contents && handle->IsInMainFrame()) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
3153 if (channel <= kMaxDisableEncryptionChannel) { 3162 if (channel <= kMaxDisableEncryptionChannel) {
3154 static const char* const kWebRtcDevSwitchNames[] = { 3163 static const char* const kWebRtcDevSwitchNames[] = {
3155 switches::kDisableWebRtcEncryption, 3164 switches::kDisableWebRtcEncryption,
3156 }; 3165 };
3157 to_command_line->CopySwitchesFrom(from_command_line, 3166 to_command_line->CopySwitchesFrom(from_command_line,
3158 kWebRtcDevSwitchNames, 3167 kWebRtcDevSwitchNames,
3159 arraysize(kWebRtcDevSwitchNames)); 3168 arraysize(kWebRtcDevSwitchNames));
3160 } 3169 }
3161 } 3170 }
3162 #endif // defined(ENABLE_WEBRTC) 3171 #endif // defined(ENABLE_WEBRTC)
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/plugins/flash_download_interception.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698