Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: ui/message_center/notifier_settings.h

Issue 1657913003: Refactor of ProfileInfoCache in c/b/notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix errors Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 UI_MESSAGE_CENTER_NOTIFIER_SETTINGS_H_ 5 #ifndef UI_MESSAGE_CENTER_NOTIFIER_SETTINGS_H_
6 #define UI_MESSAGE_CENTER_NOTIFIER_SETTINGS_H_ 6 #define UI_MESSAGE_CENTER_NOTIFIER_SETTINGS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector>
dewittj 2016/02/08 18:07:10 nit: I don't think this is used in this header fil
lwchkg 2016/02/08 19:06:43 See line 180 (marked in comment.)
dewittj 2016/02/08 19:11:45 right. Thanks!
11 12
12 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
15 #include "ui/gfx/image/image.h" 16 #include "ui/gfx/image/image.h"
16 #include "ui/message_center/message_center_export.h" 17 #include "ui/message_center/message_center_export.h"
17 #include "url/gurl.h" 18 #include "url/gurl.h"
18 19
19 class MessageCenterNotificationsTest; 20 class MessageCenterNotificationsTest;
20 class MessageCenterTrayBridgeTest; 21 class MessageCenterTrayBridgeTest;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // The icon image of the notifier. The extension icon or favicon. 108 // The icon image of the notifier. The extension icon or favicon.
108 gfx::Image icon; 109 gfx::Image icon;
109 110
110 private: 111 private:
111 DISALLOW_COPY_AND_ASSIGN(Notifier); 112 DISALLOW_COPY_AND_ASSIGN(Notifier);
112 }; 113 };
113 114
114 struct MESSAGE_CENTER_EXPORT NotifierGroup { 115 struct MESSAGE_CENTER_EXPORT NotifierGroup {
115 NotifierGroup(const gfx::Image& icon, 116 NotifierGroup(const gfx::Image& icon,
116 const base::string16& name, 117 const base::string16& name,
117 const base::string16& login_info, 118 const base::string16& login_info);
118 size_t index);
119 ~NotifierGroup(); 119 ~NotifierGroup();
120 120
121 // Icon of a notifier group. 121 // Icon of a notifier group.
122 const gfx::Image icon; 122 const gfx::Image icon;
123 123
124 // Display name of a notifier group. 124 // Display name of a notifier group.
125 const base::string16 name; 125 const base::string16 name;
126 126
127 // More display information about the notifier group. 127 // More display information about the notifier group.
128 base::string16 login_info; 128 base::string16 login_info;
129 129
130 // Unique identifier for the notifier group so that they can be selected in
131 // the UI.
132 const size_t index;
133
134 private: 130 private:
135 DISALLOW_COPY_AND_ASSIGN(NotifierGroup); 131 DISALLOW_COPY_AND_ASSIGN(NotifierGroup);
136 }; 132 };
137 133
138 // An observer class implemented by the view of the NotifierSettings to get 134 // An observer class implemented by the view of the NotifierSettings to get
139 // notified when the controller has changed data. 135 // notified when the controller has changed data.
140 class MESSAGE_CENTER_EXPORT NotifierSettingsObserver { 136 class MESSAGE_CENTER_EXPORT NotifierSettingsObserver {
141 public: 137 public:
142 // Called when an icon in the controller has been updated. 138 // Called when an icon in the controller has been updated.
143 virtual void UpdateIconImage(const NotifierId& notifier_id, 139 virtual void UpdateIconImage(const NotifierId& notifier_id,
144 const gfx::Image& icon) = 0; 140 const gfx::Image& icon) = 0;
145 141
146 // Called when any change happens to the set of notifier groups. 142 // Called when any change happens to the set of notifier groups.
147 virtual void NotifierGroupChanged() = 0; 143 virtual void NotifierGroupChanged() = 0;
148 144
149 // Called when a notifier is enabled or disabled. 145 // Called when a notifier is enabled or disabled.
150 virtual void NotifierEnabledChanged(const NotifierId& notifier_id, 146 virtual void NotifierEnabledChanged(const NotifierId& notifier_id,
151 bool enabled) = 0; 147 bool enabled) = 0;
152 }; 148 };
153 149
154 // A class used by NotifierSettingsView to integrate with a setting system 150 // A class used by NotifierSettingsView to integrate with a setting system
155 // for the clients of this module. 151 // for the clients of this module.
156 class MESSAGE_CENTER_EXPORT NotifierSettingsProvider { 152 class MESSAGE_CENTER_EXPORT NotifierSettingsProvider {
157 public: 153 public:
158 virtual ~NotifierSettingsProvider() {}; 154 virtual ~NotifierSettingsProvider() {}
159 155
160 // Sets the delegate. 156 // Sets the delegate.
161 virtual void AddObserver(NotifierSettingsObserver* observer) = 0; 157 virtual void AddObserver(NotifierSettingsObserver* observer) = 0;
162 virtual void RemoveObserver(NotifierSettingsObserver* observer) = 0; 158 virtual void RemoveObserver(NotifierSettingsObserver* observer) = 0;
163 159
164 // Returns the number of notifier groups available. 160 // Returns the number of notifier groups available.
165 virtual size_t GetNotifierGroupCount() const = 0; 161 virtual size_t GetNotifierGroupCount() const = 0;
166 162
167 // Requests the model for a particular notifier group. 163 // Requests the model for a particular notifier group.
168 virtual const message_center::NotifierGroup& GetNotifierGroupAt( 164 virtual const message_center::NotifierGroup& GetNotifierGroupAt(
169 size_t index) const = 0; 165 size_t index) const = 0;
170 166
171 // Returns true if the notifier group at |index| is active. 167 // Returns true if the notifier group at |index| is active.
172 virtual bool IsNotifierGroupActiveAt(size_t index) const = 0; 168 virtual bool IsNotifierGroupActiveAt(size_t index) const = 0;
173 169
174 // Informs the settings provider that further requests to GetNotifierList 170 // Informs the settings provider that further requests to GetNotifierList
175 // should return notifiers for the specified notifier group. 171 // should return notifiers for the specified notifier group.
176 virtual void SwitchToNotifierGroup(size_t index) = 0; 172 virtual void SwitchToNotifierGroup(size_t index) = 0;
177 173
178 // Requests the currently active notifier group. 174 // Requests the currently active notifier group.
179 virtual const message_center::NotifierGroup& GetActiveNotifierGroup() 175 virtual const message_center::NotifierGroup& GetActiveNotifierGroup()
180 const = 0; 176 const = 0;
181 177
182 // Collects the current notifier list and fills to |notifiers|. Caller takes 178 // Collects the current notifier list and fills to |notifiers|. Caller takes
183 // the ownership of the elements of |notifiers|. 179 // the ownership of the elements of |notifiers|.
184 virtual void GetNotifierList(std::vector<Notifier*>* notifiers) = 0; 180 virtual void GetNotifierList(std::vector<Notifier*>* notifiers) = 0;
lwchkg 2016/02/08 19:06:43 <vector> corresponds to here.
185 181
186 // Called when the |enabled| for the |notifier| has been changed by user 182 // Called when the |enabled| for the |notifier| has been changed by user
187 // operation. 183 // operation.
188 virtual void SetNotifierEnabled(const Notifier& notifier, bool enabled) = 0; 184 virtual void SetNotifierEnabled(const Notifier& notifier, bool enabled) = 0;
189 185
190 // Called when the settings window is closed. 186 // Called when the settings window is closed.
191 virtual void OnNotifierSettingsClosing() = 0; 187 virtual void OnNotifierSettingsClosing() = 0;
192 188
193 // Called to determine if a particular notifier can respond to a request for 189 // Called to determine if a particular notifier can respond to a request for
194 // more information. 190 // more information.
195 virtual bool NotifierHasAdvancedSettings(const NotifierId& notifier_id) 191 virtual bool NotifierHasAdvancedSettings(const NotifierId& notifier_id)
196 const = 0; 192 const = 0;
197 193
198 // Called upon request for more information about a particular notifier. 194 // Called upon request for more information about a particular notifier.
199 virtual void OnNotifierAdvancedSettingsRequested( 195 virtual void OnNotifierAdvancedSettingsRequested(
200 const NotifierId& notifier_id, 196 const NotifierId& notifier_id,
201 const std::string* notification_id) = 0; 197 const std::string* notification_id) = 0;
202 }; 198 };
203 199
204 } // namespace message_center 200 } // namespace message_center
205 201
206 #endif // UI_MESSAGE_CENTER_NOTIFIER_SETTINGS_H_ 202 #endif // UI_MESSAGE_CENTER_NOTIFIER_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698