| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_MANAGER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "chrome/browser/download/download_ui_controller.h" | 10 #include "chrome/browser/download/download_ui_controller.h" |
| 11 #include "chrome/browser/download/notification/download_item_notification.h" | 11 #include "chrome/browser/download/notification/download_item_notification.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "content/public/browser/download_item.h" | 13 #include "content/public/browser/download_item.h" |
| 14 | 14 |
| 15 class DownloadNotificationManagerForProfile; | 15 class DownloadNotificationManagerForProfile; |
| 16 | 16 |
| 17 class DownloadNotificationManager : public DownloadUIController::Delegate { | 17 class DownloadNotificationManager : public DownloadUIController::Delegate { |
| 18 public: | 18 public: |
| 19 static bool IsEnabled(); | |
| 20 | |
| 21 explicit DownloadNotificationManager(Profile* profile); | 19 explicit DownloadNotificationManager(Profile* profile); |
| 22 ~DownloadNotificationManager() override; | 20 ~DownloadNotificationManager() override; |
| 23 | 21 |
| 24 void OnAllDownloadsRemoving(Profile* profile); | 22 void OnAllDownloadsRemoving(Profile* profile); |
| 25 // DownloadUIController::Delegate: | 23 // DownloadUIController::Delegate: |
| 26 void OnNewDownloadReady(content::DownloadItem* item) override; | 24 void OnNewDownloadReady(content::DownloadItem* item) override; |
| 27 | 25 |
| 28 DownloadNotificationManagerForProfile* GetForProfile(Profile* profile) const; | 26 DownloadNotificationManagerForProfile* GetForProfile(Profile* profile) const; |
| 29 | 27 |
| 30 private: | 28 private: |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 std::map<content::DownloadItem*, DownloadItemNotification*> items_; | 67 std::map<content::DownloadItem*, DownloadItemNotification*> items_; |
| 70 | 68 |
| 71 // Pointer to the message center instance. | 69 // Pointer to the message center instance. |
| 72 message_center::MessageCenter* message_center_; | 70 message_center::MessageCenter* message_center_; |
| 73 | 71 |
| 74 STLValueDeleter<std::map<content::DownloadItem*, DownloadItemNotification*>> | 72 STLValueDeleter<std::map<content::DownloadItem*, DownloadItemNotification*>> |
| 75 items_deleter_; | 73 items_deleter_; |
| 76 }; | 74 }; |
| 77 | 75 |
| 78 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_MANAGER_H_ | 76 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |