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_GDATA_GDATA_DOWNLOAD_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 static void GetGDataTempDownloadPath(const FilePath& gdata_tmp_download_dir, | 84 static void GetGDataTempDownloadPath(const FilePath& gdata_tmp_download_dir, |
85 FilePath* gdata_tmp_download_path); | 85 FilePath* gdata_tmp_download_path); |
86 | 86 |
87 private: | 87 private: |
88 // DownloadManager overrides. | 88 // DownloadManager overrides. |
89 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; | 89 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; |
90 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; | 90 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; |
91 | 91 |
92 // DownloadItem overrides. | 92 // DownloadItem overrides. |
93 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 93 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
94 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE {} | 94 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
95 | 95 |
96 // Adds/Removes |download| to pending_downloads_. | 96 // Adds/Removes |download| to pending_downloads_. |
97 // Also start/stop observing |download|. | 97 // Also start/stop observing |download|. |
98 void AddPendingDownload(content::DownloadItem* download); | 98 void AddPendingDownload(content::DownloadItem* download); |
99 void RemovePendingDownload(content::DownloadItem* download); | 99 void RemovePendingDownload(content::DownloadItem* download); |
100 | 100 |
101 // Remove our external data and remove our observers from |download| | 101 // Remove our external data and remove our observers from |download| |
102 void DetachFromDownload(content::DownloadItem* download); | 102 void DetachFromDownload(content::DownloadItem* download); |
103 | 103 |
104 // Starts the upload of a downloaded/downloading file. | 104 // Starts the upload of a downloaded/downloading file. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // Note: This should remain the last member so it'll be destroyed and | 158 // Note: This should remain the last member so it'll be destroyed and |
159 // invalidate its weak pointers before any other members are destroyed. | 159 // invalidate its weak pointers before any other members are destroyed. |
160 base::WeakPtrFactory<GDataDownloadObserver> weak_ptr_factory_; | 160 base::WeakPtrFactory<GDataDownloadObserver> weak_ptr_factory_; |
161 | 161 |
162 DISALLOW_COPY_AND_ASSIGN(GDataDownloadObserver); | 162 DISALLOW_COPY_AND_ASSIGN(GDataDownloadObserver); |
163 }; | 163 }; |
164 | 164 |
165 } // namespace gdata | 165 } // namespace gdata |
166 | 166 |
167 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H_ | 167 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H_ |
OLD | NEW |