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 explicit NotifierSource(message_center::NotifierSettingsObserver* parent); | |
| 24 virtual ~NotifierSource(); | |
|
dewittj
2016/06/16 19:45:36
This could be more concisely spelled
virtual ~Not
hirono
2016/06/17 04:56:47
Done.
| |
| 25 | |
| 26 // Returns notifiers. | |
| 27 // If the source starts loading for icon images, it needs to call | |
| 28 // parent_->UpdateIconImage after the icon is loaded. | |
| 29 virtual std::vector<std::unique_ptr<message_center::Notifier>> | |
| 30 GetNotifierList(Profile* profile) = 0; | |
| 31 | |
| 32 // Set notifier enabled. |notifier| must have notifier type that can be | |
| 33 // handled by the source. It has responsibility to invoke | |
| 34 // parent_->NotifierEnabledChanged. | |
| 35 virtual void SetNotifierEnabled(Profile* profile, | |
| 36 const message_center::Notifier& notifier, | |
| 37 bool enabled) = 0; | |
| 38 | |
| 39 // Release temporary resouces tagged with notifier list that is returned last | |
| 40 // time. | |
| 41 virtual void OnNotifierSettingsClosing(); | |
| 42 | |
| 43 // Notifier type provided by the source. | |
| 44 virtual message_center::NotifierId::NotifierType GetNotifierType() = 0; | |
| 45 | |
| 46 protected: | |
| 47 // Lifetime of parent must be longer than the source. | |
| 48 message_center::NotifierSettingsObserver* const parent_; | |
| 49 | |
| 50 private: | |
| 51 DISALLOW_COPY_AND_ASSIGN(NotifierSource); | |
| 52 }; | |
| 53 | |
| 54 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFIER_SOURCE_H_ | |
| OLD | NEW |