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

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 tommycli@'s comments Created 4 years, 4 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 #include "extensions/common/extension_set.h" 293 #include "extensions/common/extension_set.h"
294 #include "extensions/common/manifest_handlers/background_info.h" 294 #include "extensions/common/manifest_handlers/background_info.h"
295 #include "extensions/common/manifest_handlers/shared_module_info.h" 295 #include "extensions/common/manifest_handlers/shared_module_info.h"
296 #include "extensions/common/permissions/permissions_data.h" 296 #include "extensions/common/permissions/permissions_data.h"
297 #include "extensions/common/permissions/socket_permission.h" 297 #include "extensions/common/permissions/socket_permission.h"
298 #include "extensions/common/switches.h" 298 #include "extensions/common/switches.h"
299 #endif 299 #endif
300 300
301 #if defined(ENABLE_PLUGINS) 301 #if defined(ENABLE_PLUGINS)
302 #include "chrome/browser/plugins/chrome_content_browser_client_plugins_part.h" 302 #include "chrome/browser/plugins/chrome_content_browser_client_plugins_part.h"
303 #include "chrome/browser/plugins/flash_download_interception.h"
303 #endif 304 #endif
304 305
305 #if defined(ENABLE_SPELLCHECK) 306 #if defined(ENABLE_SPELLCHECK)
306 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" 307 #include "chrome/browser/spellchecker/spellcheck_message_filter.h"
307 #endif 308 #endif
308 309
309 #if defined(USE_BROWSER_SPELLCHECKER) 310 #if defined(USE_BROWSER_SPELLCHECKER)
310 #include "components/spellcheck/browser/spellcheck_message_filter_platform.h" 311 #include "components/spellcheck/browser/spellcheck_message_filter_platform.h"
311 #endif 312 #endif
312 313
(...skipping 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after
3007 if (url.is_valid()) { 3008 if (url.is_valid()) {
3008 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), 3009 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
3009 metric, url); 3010 metric, url);
3010 } 3011 }
3011 } 3012 }
3012 3013
3013 ScopedVector<content::NavigationThrottle> 3014 ScopedVector<content::NavigationThrottle>
3014 ChromeContentBrowserClient::CreateThrottlesForNavigation( 3015 ChromeContentBrowserClient::CreateThrottlesForNavigation(
3015 content::NavigationHandle* handle) { 3016 content::NavigationHandle* handle) {
3016 ScopedVector<content::NavigationThrottle> throttles; 3017 ScopedVector<content::NavigationThrottle> throttles;
3018
3019 #if defined(ENABLE_PLUGINS)
Lei Zhang 2016/08/25 00:55:06 Merge into the if block below? if (handle->IsInMa
trizzofo 2016/08/25 01:50:36 Done.
3020 if (handle->IsInMainFrame()) {
3021 std::unique_ptr<content::NavigationThrottle> flash_url_throttle =
3022 FlashDownloadInterception::MaybeCreateThrottleFor(handle);
3023 if (flash_url_throttle)
3024 throttles.push_back(std::move(flash_url_throttle));
3025 }
3026 #endif
3027
3017 if (handle->IsInMainFrame()) { 3028 if (handle->IsInMainFrame()) {
3018 throttles.push_back( 3029 throttles.push_back(
3019 page_load_metrics::MetricsNavigationThrottle::Create(handle)); 3030 page_load_metrics::MetricsNavigationThrottle::Create(handle));
3020 } 3031 }
3021 3032
3022 #if defined(OS_ANDROID) 3033 #if defined(OS_ANDROID)
3023 // TODO(davidben): This is insufficient to integrate with prerender properly. 3034 // TODO(davidben): This is insufficient to integrate with prerender properly.
3024 // https://crbug.com/370595 3035 // https://crbug.com/370595
3025 prerender::PrerenderContents* prerender_contents = 3036 prerender::PrerenderContents* prerender_contents =
3026 prerender::PrerenderContents::FromWebContents(handle->GetWebContents()); 3037 prerender::PrerenderContents::FromWebContents(handle->GetWebContents());
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3160 if (channel <= kMaxDisableEncryptionChannel) { 3171 if (channel <= kMaxDisableEncryptionChannel) {
3161 static const char* const kWebRtcDevSwitchNames[] = { 3172 static const char* const kWebRtcDevSwitchNames[] = {
3162 switches::kDisableWebRtcEncryption, 3173 switches::kDisableWebRtcEncryption,
3163 }; 3174 };
3164 to_command_line->CopySwitchesFrom(from_command_line, 3175 to_command_line->CopySwitchesFrom(from_command_line,
3165 kWebRtcDevSwitchNames, 3176 kWebRtcDevSwitchNames,
3166 arraysize(kWebRtcDevSwitchNames)); 3177 arraysize(kWebRtcDevSwitchNames));
3167 } 3178 }
3168 } 3179 }
3169 #endif // defined(ENABLE_WEBRTC) 3180 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698