| 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/download_file_picker_chromeos.h" | 5 #include "chrome/browser/download/download_file_picker_chromeos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/i18n/file_util_icu.h" | 8 #include "base/i18n/file_util_icu.h" |
| 9 #include "chrome/browser/chromeos/gdata/drive_download_observer.h" | 9 #include "chrome/browser/chromeos/gdata/drive_download_observer.h" |
| 10 #include "chrome/browser/chromeos/gdata/drive_file_system_util.h" | 10 #include "chrome/browser/chromeos/gdata/drive_file_system_util.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 int index, | 47 int index, |
| 48 void* params) { | 48 void* params) { |
| 49 FilePath path = file_info.file_path; | 49 FilePath path = file_info.file_path; |
| 50 file_util::NormalizeFileNameEncoding(&path); | 50 file_util::NormalizeFileNameEncoding(&path); |
| 51 | 51 |
| 52 // Need to do this before we substitute with a temporary path. Otherwise we | 52 // Need to do this before we substitute with a temporary path. Otherwise we |
| 53 // won't be able to detect path changes. | 53 // won't be able to detect path changes. |
| 54 RecordFileSelected(path); | 54 RecordFileSelected(path); |
| 55 | 55 |
| 56 if (download_manager_) { | 56 if (download_manager_) { |
| 57 content::DownloadItem* download = | 57 DownloadItem* download = download_manager_->GetDownload(download_id_); |
| 58 download_manager_->GetActiveDownloadItem(download_id_); | |
| 59 gdata::DriveDownloadObserver::SubstituteDriveDownloadPath( | 58 gdata::DriveDownloadObserver::SubstituteDriveDownloadPath( |
| 60 NULL, path, download, | 59 NULL, path, download, |
| 61 base::Bind(&DownloadFilePickerChromeOS::OnFileSelected, | 60 base::Bind(&DownloadFilePickerChromeOS::OnFileSelected, |
| 62 base::Unretained(this))); | 61 base::Unretained(this))); |
| 63 } else { | 62 } else { |
| 64 OnFileSelected(FilePath()); | 63 OnFileSelected(FilePath()); |
| 65 } | 64 } |
| 66 // The OnFileSelected() call deletes |this| | 65 // The OnFileSelected() call deletes |this| |
| 67 } | 66 } |
| OLD | NEW |