OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_NOTIFICATIONS_APPLICATION_NOTIFIER_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_APPLICATION_NOTIFIER_SOURCE_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_APPLICATION_NOTIFIER_SOURCE_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_APPLICATION_NOTIFIER_SOURCE_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/extension_app_icon_loader.h" | |
9 #include "chrome/browser/notifications/notifier_source.h" | 8 #include "chrome/browser/notifications/notifier_source.h" |
| 9 #include "chrome/browser/ui/app_icon_loader_delegate.h" |
| 10 |
| 11 class AppIconLoader; |
10 | 12 |
11 class ApplicationNotifierSource : public NotifierSource, | 13 class ApplicationNotifierSource : public NotifierSource, |
12 public AppIconLoaderDelegate { | 14 public AppIconLoaderDelegate { |
13 public: | 15 public: |
14 explicit ApplicationNotifierSource(Observer* observer); | 16 explicit ApplicationNotifierSource(Observer* observer); |
15 ~ApplicationNotifierSource() override; | 17 ~ApplicationNotifierSource() override; |
16 | 18 |
17 std::vector<std::unique_ptr<message_center::Notifier>> GetNotifierList( | 19 std::vector<std::unique_ptr<message_center::Notifier>> GetNotifierList( |
18 Profile* profile) override; | 20 Profile* profile) override; |
19 | 21 |
20 void SetNotifierEnabled(Profile* profile, | 22 void SetNotifierEnabled(Profile* profile, |
21 const message_center::Notifier& notifier, | 23 const message_center::Notifier& notifier, |
22 bool enabled) override; | 24 bool enabled) override; |
23 | 25 |
24 message_center::NotifierId::NotifierType GetNotifierType() override; | 26 message_center::NotifierId::NotifierType GetNotifierType() override; |
25 | 27 |
26 private: | 28 private: |
27 // Overridden from AppIconLoaderDelegate. | 29 // Overridden from AppIconLoaderDelegate. |
28 void OnAppImageUpdated(const std::string& id, | 30 void OnAppImageUpdated(const std::string& id, |
29 const gfx::ImageSkia& image) override; | 31 const gfx::ImageSkia& image) override; |
30 | 32 |
31 std::unique_ptr<AppIconLoader> app_icon_loader_; | 33 std::unique_ptr<AppIconLoader> app_icon_loader_; |
32 | 34 |
33 // Lifetime of parent must be longer than the source. | 35 // Lifetime of parent must be longer than the source. |
34 Observer* observer_; | 36 Observer* observer_; |
35 }; | 37 }; |
36 | 38 |
37 #endif // CHROME_BROWSER_NOTIFICATIONS_APPLICATION_NOTIFIER_SOURCE_H_ | 39 #endif // CHROME_BROWSER_NOTIFICATIONS_APPLICATION_NOTIFIER_SOURCE_H_ |
OLD | NEW |