| OLD | NEW |
| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 return false; | 842 return false; |
| 843 | 843 |
| 844 switch (download_util::GetFileDangerLevel(virtual_path_.BaseName())) { | 844 switch (download_util::GetFileDangerLevel(virtual_path_.BaseName())) { |
| 845 case download_util::NOT_DANGEROUS: | 845 case download_util::NOT_DANGEROUS: |
| 846 return false; | 846 return false; |
| 847 | 847 |
| 848 case download_util::ALLOW_ON_USER_GESTURE: | 848 case download_util::ALLOW_ON_USER_GESTURE: |
| 849 // "Allow on user gesture" is OK when we have a user gesture and the | 849 // "Allow on user gesture" is OK when we have a user gesture and the |
| 850 // hosting page has been visited before today. | 850 // hosting page has been visited before today. |
| 851 if (download_->GetTransitionType() & | 851 if (download_->GetTransitionType() & |
| 852 content::PAGE_TRANSITION_FROM_ADDRESS_BAR) { | 852 ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) { |
| 853 return false; | 853 return false; |
| 854 } | 854 } |
| 855 return !download_->HasUserGesture() || visits == NO_VISITS_TO_REFERRER; | 855 return !download_->HasUserGesture() || visits == NO_VISITS_TO_REFERRER; |
| 856 | 856 |
| 857 case download_util::DANGEROUS: | 857 case download_util::DANGEROUS: |
| 858 return true; | 858 return true; |
| 859 } | 859 } |
| 860 NOTREACHED(); | 860 NOTREACHED(); |
| 861 return false; | 861 return false; |
| 862 } | 862 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 886 const base::FilePath& suggested_path) { | 886 const base::FilePath& suggested_path) { |
| 887 return base::FilePath(suggested_path.value() + kCrdownloadSuffix); | 887 return base::FilePath(suggested_path.value() + kCrdownloadSuffix); |
| 888 } | 888 } |
| 889 | 889 |
| 890 #if defined(OS_WIN) | 890 #if defined(OS_WIN) |
| 891 // static | 891 // static |
| 892 bool DownloadTargetDeterminer::IsAdobeReaderUpToDate() { | 892 bool DownloadTargetDeterminer::IsAdobeReaderUpToDate() { |
| 893 return g_is_adobe_reader_up_to_date_; | 893 return g_is_adobe_reader_up_to_date_; |
| 894 } | 894 } |
| 895 #endif | 895 #endif |
| OLD | NEW |