| 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/download_handler.h" | 5 #include "chrome/browser/chromeos/drive/download_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 // Key for base::SupportsUserData::Data. | 28 // Key for base::SupportsUserData::Data. |
| 29 const char kDrivePathKey[] = "DrivePath"; | 29 const char kDrivePathKey[] = "DrivePath"; |
| 30 | 30 |
| 31 // User Data stored in DownloadItem for drive path. | 31 // User Data stored in DownloadItem for drive path. |
| 32 class DriveUserData : public base::SupportsUserData::Data { | 32 class DriveUserData : public base::SupportsUserData::Data { |
| 33 public: | 33 public: |
| 34 explicit DriveUserData(const base::FilePath& path) : file_path_(path), | 34 explicit DriveUserData(const base::FilePath& path) : file_path_(path), |
| 35 is_complete_(false) {} | 35 is_complete_(false) {} |
| 36 virtual ~DriveUserData() {} | 36 ~DriveUserData() override {} |
| 37 | 37 |
| 38 const base::FilePath& file_path() const { return file_path_; } | 38 const base::FilePath& file_path() const { return file_path_; } |
| 39 const base::FilePath& cache_file_path() const { return cache_file_path_; } | 39 const base::FilePath& cache_file_path() const { return cache_file_path_; } |
| 40 void set_cache_file_path(const base::FilePath& path) { | 40 void set_cache_file_path(const base::FilePath& path) { |
| 41 cache_file_path_ = path; | 41 cache_file_path_ = path; |
| 42 } | 42 } |
| 43 bool is_complete() const { return is_complete_; } | 43 bool is_complete() const { return is_complete_; } |
| 44 void set_complete() { is_complete_ = true; } | 44 void set_complete() { is_complete_ = true; } |
| 45 | 45 |
| 46 private: | 46 private: |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 333 |
| 334 DownloadManager* DownloadHandler::GetDownloadManager(void* manager_id) { | 334 DownloadManager* DownloadHandler::GetDownloadManager(void* manager_id) { |
| 335 if (manager_id == notifier_->GetManager()) | 335 if (manager_id == notifier_->GetManager()) |
| 336 return notifier_->GetManager(); | 336 return notifier_->GetManager(); |
| 337 if (notifier_incognito_ && manager_id == notifier_incognito_->GetManager()) | 337 if (notifier_incognito_ && manager_id == notifier_incognito_->GetManager()) |
| 338 return notifier_incognito_->GetManager(); | 338 return notifier_incognito_->GetManager(); |
| 339 return NULL; | 339 return NULL; |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace drive | 342 } // namespace drive |
| OLD | NEW |