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

Side by Side Diff: chrome/browser/plugins/flash_download_interception.cc

Issue 2350913002: [HBD] Improve Flash Interception unit tests (Closed)
Patch Set: Merge branch 'refs/heads/276-hbd-intercept-creating-new-windows' into 278-hbd-update-intercept-tests 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 | « no previous file | chrome/browser/plugins/flash_download_interception_unittest.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/plugins/flash_download_interception.h" 5 #include "chrome/browser/plugins/flash_download_interception.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 10 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
11 #include "chrome/browser/plugins/plugins_field_trial.h" 11 #include "chrome/browser/plugins/plugins_field_trial.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/common/chrome_features.h" 13 #include "chrome/common/chrome_features.h"
14 #include "components/content_settings/core/browser/host_content_settings_map.h" 14 #include "components/content_settings/core/browser/host_content_settings_map.h"
15 #include "components/navigation_interception/intercept_navigation_throttle.h" 15 #include "components/navigation_interception/intercept_navigation_throttle.h"
16 #include "components/navigation_interception/navigation_params.h" 16 #include "components/navigation_interception/navigation_params.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/navigation_handle.h" 18 #include "content/public/browser/navigation_handle.h"
19 #include "content/public/browser/web_contents.h" 19 #include "content/public/browser/web_contents.h"
20 20
21 using content::BrowserThread; 21 using content::BrowserThread;
22 using content::NavigationHandle; 22 using content::NavigationHandle;
23 using content::NavigationThrottle; 23 using content::NavigationThrottle;
24 24
25 namespace { 25 namespace {
26 26
27 const char kFlashDownloadURL[] = "get.adobe.com/flashplayer"; 27 const char kFlashDownloadURL[] = "get.adobe.com/flash";
28 28
29 bool ShouldInterceptNavigation( 29 bool ShouldInterceptNavigation(
30 content::WebContents* source, 30 content::WebContents* source,
31 const navigation_interception::NavigationParams& params) { 31 const navigation_interception::NavigationParams& params) {
32 DCHECK_CURRENTLY_ON(BrowserThread::UI); 32 DCHECK_CURRENTLY_ON(BrowserThread::UI);
33 // TODO(crbug.com/626728): Implement permission prompt logic. 33 // TODO(crbug.com/626728): Implement permission prompt logic.
34 return true; 34 return true;
35 } 35 }
36 36
37 } // namespace 37 } // namespace
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 GURL source_url = handle->GetWebContents()->GetLastCommittedURL(); 81 GURL source_url = handle->GetWebContents()->GetLastCommittedURL();
82 if (!ShouldStopFlashDownloadAction(host_content_settings_map, source_url, 82 if (!ShouldStopFlashDownloadAction(host_content_settings_map, source_url,
83 handle->GetURL(), 83 handle->GetURL(),
84 handle->HasUserGesture())) { 84 handle->HasUserGesture())) {
85 return nullptr; 85 return nullptr;
86 } 86 }
87 87
88 return base::MakeUnique<navigation_interception::InterceptNavigationThrottle>( 88 return base::MakeUnique<navigation_interception::InterceptNavigationThrottle>(
89 handle, base::Bind(&ShouldInterceptNavigation), true); 89 handle, base::Bind(&ShouldInterceptNavigation), true);
90 } 90 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/plugins/flash_download_interception_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698