| 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_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 class ExtensionDownloadsEventRouter : public content::DownloadManager::Observer, | 350 class ExtensionDownloadsEventRouter : public content::DownloadManager::Observer, |
| 351 public content::DownloadItem::Observer { | 351 public content::DownloadItem::Observer { |
| 352 public: | 352 public: |
| 353 explicit ExtensionDownloadsEventRouter( | 353 explicit ExtensionDownloadsEventRouter( |
| 354 Profile* profile, content::DownloadManager* manager); | 354 Profile* profile, content::DownloadManager* manager); |
| 355 virtual ~ExtensionDownloadsEventRouter(); | 355 virtual ~ExtensionDownloadsEventRouter(); |
| 356 | 356 |
| 357 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; | 357 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; |
| 358 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; | 358 virtual void ManagerGoingDown(content::DownloadManager* manager) OVERRIDE; |
| 359 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 359 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
| 360 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE; | 360 virtual void OnDownloadRemoved(content::DownloadItem* download) OVERRIDE; |
| 361 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
| 361 | 362 |
| 362 // Used for testing. | 363 // Used for testing. |
| 363 struct DownloadsNotificationSource { | 364 struct DownloadsNotificationSource { |
| 364 std::string event_name; | 365 std::string event_name; |
| 365 Profile* profile; | 366 Profile* profile; |
| 366 }; | 367 }; |
| 367 | 368 |
| 368 private: | 369 private: |
| 369 struct OnChangedStat { | 370 struct OnChangedStat { |
| 370 OnChangedStat(); | 371 OnChangedStat(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 382 Profile* profile_; | 383 Profile* profile_; |
| 383 content::DownloadManager* manager_; | 384 content::DownloadManager* manager_; |
| 384 ItemMap downloads_; | 385 ItemMap downloads_; |
| 385 ItemJsonMap item_jsons_; | 386 ItemJsonMap item_jsons_; |
| 386 OnChangedStatMap on_changed_stats_; | 387 OnChangedStatMap on_changed_stats_; |
| 387 | 388 |
| 388 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); | 389 DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); |
| 389 }; | 390 }; |
| 390 | 391 |
| 391 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ | 392 #endif // CHROME_BROWSER_EXTENSIONS_API_DOWNLOADS_DOWNLOADS_API_H_ |
| OLD | NEW |