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

Side by Side Diff: chrome/browser/download/download_target_determiner.cc

Issue 2641063002: Fix a problem that user validated dangerous download cannot resume (Closed)
Patch Set: remove dependencies Created 3 years, 11 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/download/download_target_determiner_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/download/download_target_determiner.h" 5 #include "chrome/browser/download/download_target_determiner.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 DoLoop(); 589 DoLoop();
590 } 590 }
591 #endif 591 #endif
592 592
593 DownloadTargetDeterminer::Result 593 DownloadTargetDeterminer::Result
594 DownloadTargetDeterminer::DoCheckDownloadUrl() { 594 DownloadTargetDeterminer::DoCheckDownloadUrl() {
595 DCHECK_CURRENTLY_ON(BrowserThread::UI); 595 DCHECK_CURRENTLY_ON(BrowserThread::UI);
596 DCHECK(!virtual_path_.empty()); 596 DCHECK(!virtual_path_.empty());
597 next_state_ = STATE_CHECK_VISITED_REFERRER_BEFORE; 597 next_state_ = STATE_CHECK_VISITED_REFERRER_BEFORE;
598 598
599 // If user has validated a dangerous download, don't check.
600 if (danger_type_ == content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED)
601 return CONTINUE;
602
599 delegate_->CheckDownloadUrl( 603 delegate_->CheckDownloadUrl(
600 download_, 604 download_,
601 virtual_path_, 605 virtual_path_,
602 base::Bind(&DownloadTargetDeterminer::CheckDownloadUrlDone, 606 base::Bind(&DownloadTargetDeterminer::CheckDownloadUrlDone,
603 weak_ptr_factory_.GetWeakPtr())); 607 weak_ptr_factory_.GetWeakPtr()));
604 return QUIT_DOLOOP; 608 return QUIT_DOLOOP;
605 } 609 }
606 610
607 void DownloadTargetDeterminer::CheckDownloadUrlDone( 611 void DownloadTargetDeterminer::CheckDownloadUrlDone(
608 content::DownloadDangerType danger_type) { 612 content::DownloadDangerType danger_type) {
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 const base::FilePath& suggested_path) { 947 const base::FilePath& suggested_path) {
944 return base::FilePath(suggested_path.value() + kCrdownloadSuffix); 948 return base::FilePath(suggested_path.value() + kCrdownloadSuffix);
945 } 949 }
946 950
947 #if defined(OS_WIN) 951 #if defined(OS_WIN)
948 // static 952 // static
949 bool DownloadTargetDeterminer::IsAdobeReaderUpToDate() { 953 bool DownloadTargetDeterminer::IsAdobeReaderUpToDate() {
950 return g_is_adobe_reader_up_to_date_; 954 return g_is_adobe_reader_up_to_date_;
951 } 955 }
952 #endif 956 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_target_determiner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698