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 #include "chrome/browser/download/save_package_file_picker.h" | 5 #include "chrome/browser/download/save_package_file_picker.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 UMA_HISTOGRAM_ENUMERATION("Download.SavePageType", | 249 UMA_HISTOGRAM_ENUMERATION("Download.SavePageType", |
250 save_type, | 250 save_type, |
251 content::SAVE_PAGE_TYPE_MAX); | 251 content::SAVE_PAGE_TYPE_MAX); |
252 } else { | 252 } else { |
253 // Use "HTML Only" type as a dummy. | 253 // Use "HTML Only" type as a dummy. |
254 save_type = content::SAVE_PAGE_TYPE_AS_ONLY_HTML; | 254 save_type = content::SAVE_PAGE_TYPE_AS_ONLY_HTML; |
255 } | 255 } |
256 | 256 |
257 base::FilePath path_copy(path); | 257 base::FilePath path_copy(path); |
258 file_util::NormalizeFileNameEncoding(&path_copy); | 258 base::i18n::NormalizeFileNameEncoding(&path_copy); |
259 | 259 |
260 download_prefs_->SetSaveFilePath(path_copy.DirName()); | 260 download_prefs_->SetSaveFilePath(path_copy.DirName()); |
261 | 261 |
262 #if defined(OS_CHROMEOS) | 262 #if defined(OS_CHROMEOS) |
263 if (drive::util::IsUnderDriveMountPoint(path_copy)) { | 263 if (drive::util::IsUnderDriveMountPoint(path_copy)) { |
264 // Here's a map to the callback chain: | 264 // Here's a map to the callback chain: |
265 // SubstituteDriveDownloadPath -> | 265 // SubstituteDriveDownloadPath -> |
266 // ContinueSettingUpDriveDownload -> | 266 // ContinueSettingUpDriveDownload -> |
267 // callback_ = SavePackage::OnPathPicked -> | 267 // callback_ = SavePackage::OnPathPicked -> |
268 // download_created_callback = OnSavePackageDownloadCreatedChromeOS | 268 // download_created_callback = OnSavePackageDownloadCreatedChromeOS |
(...skipping 11 matching lines...) Expand all Loading... |
280 } | 280 } |
281 #endif | 281 #endif |
282 | 282 |
283 callback_.Run(path_copy, save_type, | 283 callback_.Run(path_copy, save_type, |
284 base::Bind(&OnSavePackageDownloadCreated)); | 284 base::Bind(&OnSavePackageDownloadCreated)); |
285 } | 285 } |
286 | 286 |
287 void SavePackageFilePicker::FileSelectionCanceled(void* unused_params) { | 287 void SavePackageFilePicker::FileSelectionCanceled(void* unused_params) { |
288 delete this; | 288 delete this; |
289 } | 289 } |
OLD | NEW |