Evan Stade | d6d837f | 2017-09-29 02:51:02 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_NOTIFICATIONS_EXTENSION_NOTIFIER_CONTROLLER_H_ |
| 6 | #define CHROME_BROWSER_NOTIFICATIONS_EXTENSION_NOTIFIER_CONTROLLER_H_ |
| 7 | |
| 8 | #include "chrome/browser/notifications/notifier_controller.h" |
| 9 | #include "chrome/browser/ui/app_icon_loader_delegate.h" |
| 10 | |
| 11 | class AppIconLoader; |
| 12 | |
| 13 | // Controls extensions and apps. Each extension gets its own row in the settings |
| 14 | // ui. |
| 15 | class ExtensionNotifierController : public NotifierController, |
| 16 | public AppIconLoaderDelegate { |
| 17 | public: |
| 18 | explicit ExtensionNotifierController(Observer* observer); |
| 19 | ~ExtensionNotifierController() override; |
| 20 | |
Evan Stade | feec2d11 | 2017-10-19 03:24:53 | [diff] [blame] | 21 | // NotifierController: |
Evan Stade | ecfc48c | 2019-06-17 21:35:23 | [diff] [blame] | 22 | std::vector<ash::NotifierMetadata> GetNotifierList(Profile* profile) override; |
Evan Stade | d6d837f | 2017-09-29 02:51:02 | [diff] [blame] | 23 | void SetNotifierEnabled(Profile* profile, |
| 24 | const message_center::NotifierId& notifier_id, |
| 25 | bool enabled) override; |
Evan Stade | d6d837f | 2017-09-29 02:51:02 | [diff] [blame] | 26 | |
| 27 | private: |
| 28 | // Overridden from AppIconLoaderDelegate. |
| 29 | void OnAppImageUpdated(const std::string& id, |
| 30 | const gfx::ImageSkia& image) override; |
| 31 | |
| 32 | std::unique_ptr<AppIconLoader> app_icon_loader_; |
| 33 | |
| 34 | // Lifetime of parent must be longer than the source. |
| 35 | Observer* observer_; |
| 36 | }; |
| 37 | |
| 38 | #endif // CHROME_BROWSER_NOTIFICATIONS_EXTENSION_NOTIFIER_CONTROLLER_H_ |