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_chromeos.h" | 5 #include "chrome/browser/download/save_package_file_picker_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 if (!web_contents()) { | 83 if (!web_contents()) { |
84 delete this; | 84 delete this; |
85 return; | 85 return; |
86 } | 86 } |
87 FilePath selected_path = selected_file_info.file_path; | 87 FilePath selected_path = selected_file_info.file_path; |
88 file_util::NormalizeFileNameEncoding(&selected_path); | 88 file_util::NormalizeFileNameEncoding(&selected_path); |
89 Profile* profile = Profile::FromBrowserContext( | 89 Profile* profile = Profile::FromBrowserContext( |
90 web_contents()->GetBrowserContext()); | 90 web_contents()->GetBrowserContext()); |
91 DCHECK(profile); | 91 DCHECK(profile); |
92 | 92 |
93 if (gdata::util::IsUnderGDataMountPoint(selected_path)) { | 93 if (gdata::util::IsUnderDriveMountPoint(selected_path)) { |
94 // Here's a map to the callback chain: | 94 // Here's a map to the callback chain: |
95 // GetDriveTempDownloadPath -> | 95 // GetDriveTempDownloadPath -> |
96 // ContinueSettingUpDriveDownload -> | 96 // ContinueSettingUpDriveDownload -> |
97 // callback_ = SavePackage::OnPathPicked -> | 97 // callback_ = SavePackage::OnPathPicked -> |
98 // download_created_callback = OnSavePackageDownloadCreated | 98 // download_created_callback = OnSavePackageDownloadCreated |
99 gdata::DriveDownloadObserver::SubstituteDriveDownloadPath( | 99 gdata::DriveDownloadObserver::SubstituteDriveDownloadPath( |
100 profile, selected_path, NULL, | 100 profile, selected_path, NULL, |
101 base::Bind(&ContinueSettingUpDriveDownload, callback_, selected_path)); | 101 base::Bind(&ContinueSettingUpDriveDownload, callback_, selected_path)); |
102 } else { | 102 } else { |
103 callback_.Run(selected_path, content::SAVE_PAGE_TYPE_AS_MHTML, | 103 callback_.Run(selected_path, content::SAVE_PAGE_TYPE_AS_MHTML, |
104 content::SavePackageDownloadCreatedCallback()); | 104 content::SavePackageDownloadCreatedCallback()); |
105 } | 105 } |
106 delete this; | 106 delete this; |
107 } | 107 } |
108 | 108 |
109 void SavePackageFilePickerChromeOS::FileSelectionCanceled(void* params) { | 109 void SavePackageFilePickerChromeOS::FileSelectionCanceled(void* params) { |
110 delete this; | 110 delete this; |
111 } | 111 } |
OLD | NEW |