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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DOWNLOAD_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DOWNLOAD_HANDLER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DOWNLOAD_HANDLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DOWNLOAD_HANDLER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/download/all_download_item_notifier.h" | 13 #include "chrome/browser/download/all_download_item_notifier.h" |
11 #include "components/drive/file_errors.h" | 14 #include "components/drive/file_errors.h" |
12 #include "content/public/browser/download_manager_delegate.h" | 15 #include "content/public/browser/download_manager_delegate.h" |
13 | 16 |
14 class Profile; | 17 class Profile; |
15 | 18 |
16 namespace content { | 19 namespace content { |
17 class DownloadItem; | 20 class DownloadItem; |
18 class DownloadManager; | 21 class DownloadManager; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 70 |
68 // Checks if there is a Drive upload associated with |download| | 71 // Checks if there is a Drive upload associated with |download| |
69 bool IsDriveDownload(const content::DownloadItem* download); | 72 bool IsDriveDownload(const content::DownloadItem* download); |
70 | 73 |
71 // Checks a file corresponding to the download item exists in Drive. | 74 // Checks a file corresponding to the download item exists in Drive. |
72 void CheckForFileExistence( | 75 void CheckForFileExistence( |
73 const content::DownloadItem* download, | 76 const content::DownloadItem* download, |
74 const content::CheckForFileExistenceCallback& callback); | 77 const content::CheckForFileExistenceCallback& callback); |
75 | 78 |
76 // Calculates request space for |downloads|. | 79 // Calculates request space for |downloads|. |
77 int64 CalculateRequestSpace( | 80 int64_t CalculateRequestSpace( |
78 const content::DownloadManager::DownloadVector& downloads); | 81 const content::DownloadManager::DownloadVector& downloads); |
79 | 82 |
80 // Checks available storage space and free disk space if necessary. Actual | 83 // Checks available storage space and free disk space if necessary. Actual |
81 // execution is delayed and rate limited. | 84 // execution is delayed and rate limited. |
82 void FreeDiskSpaceIfNeeded(); | 85 void FreeDiskSpaceIfNeeded(); |
83 | 86 |
84 // Checks available storage space and free disk space if necessary. This is | 87 // Checks available storage space and free disk space if necessary. This is |
85 // executed immediately. | 88 // executed immediately. |
86 void FreeDiskSpaceIfNeededImmediately(); | 89 void FreeDiskSpaceIfNeededImmediately(); |
87 | 90 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // Note: This should remain the last member so it'll be destroyed and | 138 // Note: This should remain the last member so it'll be destroyed and |
136 // invalidate its weak pointers before any other members are destroyed. | 139 // invalidate its weak pointers before any other members are destroyed. |
137 base::WeakPtrFactory<DownloadHandler> weak_ptr_factory_; | 140 base::WeakPtrFactory<DownloadHandler> weak_ptr_factory_; |
138 | 141 |
139 DISALLOW_COPY_AND_ASSIGN(DownloadHandler); | 142 DISALLOW_COPY_AND_ASSIGN(DownloadHandler); |
140 }; | 143 }; |
141 | 144 |
142 } // namespace drive | 145 } // namespace drive |
143 | 146 |
144 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DOWNLOAD_HANDLER_H_ | 147 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DOWNLOAD_HANDLER_H_ |
OLD | NEW |