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

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

Issue 2182333003: Revert of Sample 1% url whitelisted PPAPI downloads to ping safe browsing server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« 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()),
536 base::Bind(&InterpretSafeBrowsingVerdict, 535 base::Bind(&InterpretSafeBrowsingVerdict,
537 base::Bind(&FileSelectHelper::ProceedWithSafeBrowsingVerdict, 536 base::Bind(&FileSelectHelper::ProceedWithSafeBrowsingVerdict,
538 this, default_file_path, base::Passed(&params)))); 537 this, default_file_path, base::Passed(&params))));
539 } 538 }
540 539
541 void FileSelectHelper::ProceedWithSafeBrowsingVerdict( 540 void FileSelectHelper::ProceedWithSafeBrowsingVerdict(
542 const base::FilePath& default_file_path, 541 const base::FilePath& default_file_path,
543 std::unique_ptr<content::FileChooserParams> params, 542 std::unique_ptr<content::FileChooserParams> params,
544 bool allowed_by_safe_browsing) { 543 bool allowed_by_safe_browsing) {
545 if (!allowed_by_safe_browsing) { 544 if (!allowed_by_safe_browsing) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 688
690 // static 689 // static
691 base::FilePath FileSelectHelper::GetSanitizedFileName( 690 base::FilePath FileSelectHelper::GetSanitizedFileName(
692 const base::FilePath& suggested_filename) { 691 const base::FilePath& suggested_filename) {
693 if (suggested_filename.empty()) 692 if (suggested_filename.empty())
694 return base::FilePath(); 693 return base::FilePath();
695 return net::GenerateFileName( 694 return net::GenerateFileName(
696 GURL(), std::string(), std::string(), suggested_filename.AsUTF8Unsafe(), 695 GURL(), std::string(), std::string(), suggested_filename.AsUTF8Unsafe(),
697 std::string(), l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME)); 696 std::string(), l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
698 } 697 }
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