Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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_NOTIFIER_SOURCE_H_ | |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFIER_SOURCE_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "ui/message_center/notifier_settings.h" | |
| 13 | |
| 14 class Profile; | |
| 15 | |
| 16 namespace message_center { | |
| 17 struct Notifier; | |
| 18 class NotifierSettingsObserver; | |
| 19 } | |
| 20 | |
| 21 class NotifierSource { | |
| 22 public: | |
| 23 class Observer { | |
| 24 public: | |
| 25 virtual void OnIconImageUpdated(const message_center::NotifierId& id, | |
| 26 const gfx::Image& image) = 0; | |
| 27 virtual void OnNotifierEnabledChanged(const message_center::NotifierId& id, | |
| 28 bool enabled) = 0; | |
| 29 }; | |
| 30 | |
| 31 NotifierSource() = default; | |
|
dewittj
2016/06/20 17:14:22
Do you need this?
hirono
2016/06/21 00:46:02
Yes, because DISALLOW_COPY_AND_ASSIGN adds private
| |
| 32 virtual ~NotifierSource() = default; | |
| 33 | |
| 34 // Returns notifiers. | |
| 35 // If the source starts loading for icon images, it needs to call | |
| 36 // Observer::OnIconImageUpdated after the icon is loaded. | |
| 37 virtual std::vector<std::unique_ptr<message_center::Notifier>> | |
| 38 GetNotifierList(Profile* profile) = 0; | |
| 39 | |
| 40 // Set notifier enabled. |notifier| must have notifier type that can be | |
| 41 // handled by the source. It has responsibility to invoke | |
| 42 // Observer::OnNotifierEnabledChanged. | |
| 43 virtual void SetNotifierEnabled(Profile* profile, | |
| 44 const message_center::Notifier& notifier, | |
| 45 bool enabled) = 0; | |
| 46 | |
| 47 // Release temporary resouces tagged with notifier list that is returned last | |
| 48 // time. | |
| 49 virtual void OnNotifierSettingsClosing() {} | |
| 50 | |
| 51 // Notifier type provided by the source. | |
| 52 virtual message_center::NotifierId::NotifierType GetNotifierType() = 0; | |
| 53 | |
| 54 private: | |
| 55 DISALLOW_COPY_AND_ASSIGN(NotifierSource); | |
| 56 }; | |
| 57 | |
| 58 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFIER_SOURCE_H_ | |
| OLD | NEW |