| 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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 DownloadNotificationManagerForProfile* GetForProfile(Profile* profile) const; | 26 DownloadNotificationManagerForProfile* GetForProfile(Profile* profile) const; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 friend class test::DownloadItemNotificationTest; | 29 friend class test::DownloadItemNotificationTest; |
| 30 | 30 |
| 31 Profile* main_profile_ = nullptr; | 31 Profile* main_profile_ = nullptr; |
| 32 std::map<Profile*, DownloadNotificationManagerForProfile*> | 32 std::map<Profile*, DownloadNotificationManagerForProfile*> |
| 33 manager_for_profile_; | 33 manager_for_profile_; |
| 34 | 34 |
| 35 STLValueDeleter<std::map<Profile*, DownloadNotificationManagerForProfile*>> | 35 base::STLValueDeleter< |
| 36 std::map<Profile*, DownloadNotificationManagerForProfile*>> |
| 36 items_deleter_; | 37 items_deleter_; |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 class DownloadNotificationManagerForProfile | 40 class DownloadNotificationManagerForProfile |
| 40 : public content::DownloadItem::Observer { | 41 : public content::DownloadItem::Observer { |
| 41 public: | 42 public: |
| 42 DownloadNotificationManagerForProfile( | 43 DownloadNotificationManagerForProfile( |
| 43 Profile* profile, DownloadNotificationManager* parent_manager); | 44 Profile* profile, DownloadNotificationManager* parent_manager); |
| 44 ~DownloadNotificationManagerForProfile() override; | 45 ~DownloadNotificationManagerForProfile() override; |
| 45 | 46 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 62 message_center::MessageCenter* message_center); | 63 message_center::MessageCenter* message_center); |
| 63 | 64 |
| 64 Profile* profile_ = nullptr; | 65 Profile* profile_ = nullptr; |
| 65 DownloadNotificationManager* parent_manager_; // weak | 66 DownloadNotificationManager* parent_manager_; // weak |
| 66 std::set<content::DownloadItem*> downloading_items_; | 67 std::set<content::DownloadItem*> downloading_items_; |
| 67 std::map<content::DownloadItem*, DownloadItemNotification*> items_; | 68 std::map<content::DownloadItem*, DownloadItemNotification*> items_; |
| 68 | 69 |
| 69 // Pointer to the message center instance. | 70 // Pointer to the message center instance. |
| 70 message_center::MessageCenter* message_center_; | 71 message_center::MessageCenter* message_center_; |
| 71 | 72 |
| 72 STLValueDeleter<std::map<content::DownloadItem*, DownloadItemNotification*>> | 73 base::STLValueDeleter< |
| 74 std::map<content::DownloadItem*, DownloadItemNotification*>> |
| 73 items_deleter_; | 75 items_deleter_; |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_MANAGER_H_ | 78 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |