OLD | NEW |
---|---|
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 // Download utility implementation | 5 // Download utility implementation |
6 | 6 |
7 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 7 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
8 | 8 |
9 #include "chrome/browser/download/download_util.h" | 9 #include "chrome/browser/download/download_util.h" |
10 | 10 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 bool DownloadPathIsDangerous(const FilePath& download_path) { | 161 bool DownloadPathIsDangerous(const FilePath& download_path) { |
162 #if defined(OS_LINUX) | 162 #if defined(OS_LINUX) |
163 FilePath home_dir = file_util::GetHomeDir(); | 163 FilePath home_dir = file_util::GetHomeDir(); |
164 if (download_path == home_dir) { | 164 if (download_path == home_dir) { |
165 return true; | 165 return true; |
166 } | 166 } |
167 #endif | 167 #endif |
168 | 168 |
169 FilePath desktop_dir; | 169 FilePath desktop_dir; |
170 if (!PathService::Get(chrome::DIR_USER_DESKTOP, &desktop_dir)) { | 170 if (!PathService::Get(chrome::DIR_USER_DESKTOP, &desktop_dir)) { |
171 NOTREACHED(); | |
asanka
2012/07/27 19:19:46
If this check doesn't apply to OS_ANDROID, I'd rat
nilesh
2012/07/27 20:09:25
Done.
| |
172 return false; | 171 return false; |
173 } | 172 } |
174 return (download_path == desktop_dir); | 173 return (download_path == desktop_dir); |
175 } | 174 } |
176 | 175 |
177 // Download progress painting -------------------------------------------------- | 176 // Download progress painting -------------------------------------------------- |
178 | 177 |
179 // Common images used for download progress animations. We load them once the | 178 // Common images used for download progress animations. We load them once the |
180 // first time we do a progress paint, then reuse them as they are always the | 179 // first time we do a progress paint, then reuse them as they are always the |
181 // same. | 180 // same. |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
634 UMA_HISTOGRAM_ENUMERATION( | 633 UMA_HISTOGRAM_ENUMERATION( |
635 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY); | 634 "Download.CountsChrome", type, CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY); |
636 } | 635 } |
637 | 636 |
638 void RecordDownloadSource(ChromeDownloadSource source) { | 637 void RecordDownloadSource(ChromeDownloadSource source) { |
639 UMA_HISTOGRAM_ENUMERATION( | 638 UMA_HISTOGRAM_ENUMERATION( |
640 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY); | 639 "Download.SourcesChrome", source, CHROME_DOWNLOAD_SOURCE_LAST_ENTRY); |
641 } | 640 } |
642 | 641 |
643 } // namespace download_util | 642 } // namespace download_util |
OLD | NEW |