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

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

Issue 20066003: Update notification settings to allow for multiprofile situations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And remove unneeded include. Created 7 years, 4 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 | Annotate | Revision Log
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_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ 5 #ifndef UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_
6 #define UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ 6 #define UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_
7 7
8 #include "ui/message_center/notifier_settings.h" 8 #include "ui/message_center/notifier_settings.h"
9 9
10 namespace message_center { 10 namespace message_center {
11 11
12 // A NotifierSettingsProvider that returns a configurable, fixed set of 12 // A NotifierSettingsProvider that returns a configurable, fixed set of
13 // notifiers and records which callbacks were called. For use in tests. 13 // notifiers and records which callbacks were called. For use in tests.
14 class FakeNotifierSettingsProvider : public NotifierSettingsProvider { 14 class FakeNotifierSettingsProvider : public NotifierSettingsProvider {
15 public: 15 public:
16 FakeNotifierSettingsProvider(const std::vector<Notifier*>& notifiers); 16 FakeNotifierSettingsProvider(const std::vector<Notifier*>& notifiers);
17 ~FakeNotifierSettingsProvider(); 17 virtual ~FakeNotifierSettingsProvider();
18
19 virtual size_t GetNotifierGroupCount() const OVERRIDE;
20 virtual const message_center::NotifierGroup& GetNotifierGroupAt(
21 size_t index) const OVERRIDE;
22 virtual void SwitchToNotifierGroup(size_t index) OVERRIDE;
23 virtual const message_center::NotifierGroup& GetActiveNotifierGroup() const
24 OVERRIDE;
18 25
19 virtual void GetNotifierList(std::vector<Notifier*>* notifiers) OVERRIDE; 26 virtual void GetNotifierList(std::vector<Notifier*>* notifiers) OVERRIDE;
20 27
21 virtual void SetNotifierEnabled(const Notifier& notifier, 28 virtual void SetNotifierEnabled(const Notifier& notifier,
22 bool enabled) OVERRIDE; 29 bool enabled) OVERRIDE;
23 30
24 virtual void OnNotifierSettingsClosing() OVERRIDE; 31 virtual void OnNotifierSettingsClosing() OVERRIDE;
25 virtual void AddObserver(NotifierSettingsObserver* observer) OVERRIDE; 32 virtual void AddObserver(NotifierSettingsObserver* observer) OVERRIDE;
26 virtual void RemoveObserver(NotifierSettingsObserver* observer) OVERRIDE; 33 virtual void RemoveObserver(NotifierSettingsObserver* observer) OVERRIDE;
27 34
28 bool WasEnabled(const Notifier& notifier); 35 bool WasEnabled(const Notifier& notifier);
29 int closed_called_count(); 36 int closed_called_count();
30 37
31 private: 38 private:
32 std::vector<Notifier*> notifiers_; 39 std::vector<Notifier*> notifiers_;
33 std::map<const Notifier*, bool> enabled_; 40 std::map<const Notifier*, bool> enabled_;
41 const NotifierGroup notifier_group_;
34 int closed_called_count_; 42 int closed_called_count_;
35 }; 43 };
36 44
37 } // namespace message_center 45 } // namespace message_center
38 46
39 #endif // UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ 47 #endif // UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_
OLDNEW
« no previous file with comments | « ui/message_center/cocoa/settings_controller.mm ('k') | ui/message_center/fake_notifier_settings_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698