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

Unified Diff: chrome/browser/file_select_helper.cc

Issue 2146703002: Sample 1% url whitelisted PPAPI downloads to ping safe browsing server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix browser_tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/download_protection_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/file_select_helper.cc
diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc
index c9059e0f6cce84f82d10965ae39240c0ac9cbc27..e4c0d295268c7b10cd72349d8c04c94f81d856cf 100644
--- a/chrome/browser/file_select_helper.cc
+++ b/chrome/browser/file_select_helper.cc
@@ -25,7 +25,9 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
+#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
+#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
@@ -529,8 +531,16 @@ void FileSelectHelper::CheckDownloadRequestWithSafeBrowsing(
}
GURL requestor_url = params->requestor;
+ content::BrowserContext* browser_context = web_contents_->GetBrowserContext();
+ bool is_incognito = browser_context && browser_context->IsOffTheRecord();
+ Profile* profile = Profile::FromBrowserContext(browser_context);
+ bool is_extended_reporting =
+ profile &&
+ profile->GetPrefs()->GetBoolean(
+ prefs::kSafeBrowsingExtendedReportingEnabled);
sb_service->download_protection_service()->CheckPPAPIDownloadRequest(
requestor_url, default_file_path, alternate_extensions,
+ is_extended_reporting, is_incognito,
asanka 2016/07/14 16:48:15 Since CheckPPAPIDownloadRequest's behavior changes
Jialiu Lin 2016/07/14 20:28:35 Yep, passing the profile is much better. Done.
base::Bind(&InterpretSafeBrowsingVerdict,
base::Bind(&FileSelectHelper::ProceedWithSafeBrowsingVerdict,
this, default_file_path, base::Passed(&params))));
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/download_protection_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698