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

Side by Side 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: refactor unit 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/download_protection_service.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/file_select_helper.h" 5 #include "chrome/browser/file_select_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 default_file_path.ReplaceExtension(extension_in_list) 525 default_file_path.ReplaceExtension(extension_in_list)
526 .FinalExtension(); 526 .FinalExtension();
527 alternate_extensions.push_back(extension); 527 alternate_extensions.push_back(extension);
528 } 528 }
529 } 529 }
530 } 530 }
531 531
532 GURL requestor_url = params->requestor; 532 GURL requestor_url = params->requestor;
533 sb_service->download_protection_service()->CheckPPAPIDownloadRequest( 533 sb_service->download_protection_service()->CheckPPAPIDownloadRequest(
534 requestor_url, default_file_path, alternate_extensions, 534 requestor_url, default_file_path, alternate_extensions,
535 Profile::FromBrowserContext(web_contents_->GetBrowserContext()),
535 base::Bind(&InterpretSafeBrowsingVerdict, 536 base::Bind(&InterpretSafeBrowsingVerdict,
536 base::Bind(&FileSelectHelper::ProceedWithSafeBrowsingVerdict, 537 base::Bind(&FileSelectHelper::ProceedWithSafeBrowsingVerdict,
537 this, default_file_path, base::Passed(&params)))); 538 this, default_file_path, base::Passed(&params))));
538 } 539 }
539 540
540 void FileSelectHelper::ProceedWithSafeBrowsingVerdict( 541 void FileSelectHelper::ProceedWithSafeBrowsingVerdict(
541 const base::FilePath& default_file_path, 542 const base::FilePath& default_file_path,
542 std::unique_ptr<content::FileChooserParams> params, 543 std::unique_ptr<content::FileChooserParams> params,
543 bool allowed_by_safe_browsing) { 544 bool allowed_by_safe_browsing) {
544 if (!allowed_by_safe_browsing) { 545 if (!allowed_by_safe_browsing) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 689
689 // static 690 // static
690 base::FilePath FileSelectHelper::GetSanitizedFileName( 691 base::FilePath FileSelectHelper::GetSanitizedFileName(
691 const base::FilePath& suggested_filename) { 692 const base::FilePath& suggested_filename) {
692 if (suggested_filename.empty()) 693 if (suggested_filename.empty())
693 return base::FilePath(); 694 return base::FilePath();
694 return net::GenerateFileName( 695 return net::GenerateFileName(
695 GURL(), std::string(), std::string(), suggested_filename.AsUTF8Unsafe(), 696 GURL(), std::string(), std::string(), suggested_filename.AsUTF8Unsafe(),
696 std::string(), l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME)); 697 std::string(), l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
697 } 698 }
OLDNEW
« 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