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/chromeos/drive/drive_download_observer.h" | 5 #include "chrome/browser/chromeos/drive/drive_download_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
10 #include "chrome/browser/chromeos/drive/drive.pb.h" | 10 #include "chrome/browser/chromeos/drive/drive.pb.h" |
11 #include "chrome/browser/chromeos/drive/drive_cache.h" | 11 #include "chrome/browser/chromeos/drive/drive_cache.h" |
12 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" | 12 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" |
13 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | 13 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
14 #include "chrome/browser/chromeos/drive/drive_system_service.h" | 14 #include "chrome/browser/chromeos/drive/drive_system_service.h" |
15 #include "chrome/browser/chromeos/drive/file_write_helper.h" | 15 #include "chrome/browser/chromeos/drive/file_write_helper.h" |
16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "content/public/browser/browser_thread.h" |
17 | 18 |
18 using content::BrowserThread; | 19 using content::BrowserThread; |
19 using content::DownloadManager; | 20 using content::DownloadManager; |
20 using content::DownloadItem; | 21 using content::DownloadItem; |
21 | 22 |
22 namespace drive { | 23 namespace drive { |
23 namespace { | 24 namespace { |
24 | 25 |
25 // Key for base::SupportsUserData::Data. | 26 // Key for base::SupportsUserData::Data. |
26 const char kDrivePathKey[] = "DrivePath"; | 27 const char kDrivePathKey[] = "DrivePath"; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 250 } |
250 } | 251 } |
251 | 252 |
252 void DriveDownloadObserver::UploadDownloadItem(DownloadItem* download) { | 253 void DriveDownloadObserver::UploadDownloadItem(DownloadItem* download) { |
253 file_write_helper_->PrepareWritableFileAndRun( | 254 file_write_helper_->PrepareWritableFileAndRun( |
254 GetDrivePath(download), | 255 GetDrivePath(download), |
255 base::Bind(&MoveDownloadedFile, download->GetFullPath())); | 256 base::Bind(&MoveDownloadedFile, download->GetFullPath())); |
256 } | 257 } |
257 | 258 |
258 } // namespace drive | 259 } // namespace drive |
OLD | NEW |