OLD | NEW |
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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/message_center/notifier_settings.h" | 9 #include "ui/message_center/notifier_settings.h" |
10 | 10 |
11 namespace message_center { | 11 namespace message_center { |
12 | 12 |
13 // A NotifierSettingsProvider that returns a configurable, fixed set of | 13 // A NotifierSettingsProvider that returns a configurable, fixed set of |
14 // notifiers and records which callbacks were called. For use in tests. | 14 // notifiers and records which callbacks were called. For use in tests. |
15 class FakeNotifierSettingsProvider : public NotifierSettingsProvider { | 15 class FakeNotifierSettingsProvider : public NotifierSettingsProvider { |
16 public: | 16 public: |
17 FakeNotifierSettingsProvider(); | 17 FakeNotifierSettingsProvider(); |
18 explicit FakeNotifierSettingsProvider( | 18 explicit FakeNotifierSettingsProvider( |
19 const std::vector<Notifier*>& notifiers); | 19 const std::vector<Notifier*>& notifiers); |
20 virtual ~FakeNotifierSettingsProvider(); | 20 ~FakeNotifierSettingsProvider() override; |
21 | 21 |
22 virtual size_t GetNotifierGroupCount() const override; | 22 size_t GetNotifierGroupCount() const override; |
23 virtual const NotifierGroup& GetNotifierGroupAt(size_t index) const override; | 23 const NotifierGroup& GetNotifierGroupAt(size_t index) const override; |
24 virtual bool IsNotifierGroupActiveAt(size_t index) const override; | 24 bool IsNotifierGroupActiveAt(size_t index) const override; |
25 virtual void SwitchToNotifierGroup(size_t index) override; | 25 void SwitchToNotifierGroup(size_t index) override; |
26 virtual const NotifierGroup& GetActiveNotifierGroup() const override; | 26 const NotifierGroup& GetActiveNotifierGroup() const override; |
27 | 27 |
28 virtual void GetNotifierList(std::vector<Notifier*>* notifiers) override; | 28 void GetNotifierList(std::vector<Notifier*>* notifiers) override; |
29 | 29 |
30 virtual void SetNotifierEnabled(const Notifier& notifier, | 30 void SetNotifierEnabled(const Notifier& notifier, bool enabled) override; |
31 bool enabled) override; | |
32 | 31 |
33 virtual void OnNotifierSettingsClosing() override; | 32 void OnNotifierSettingsClosing() override; |
34 virtual bool NotifierHasAdvancedSettings(const NotifierId& notifier_id) const | 33 bool NotifierHasAdvancedSettings( |
35 override; | 34 const NotifierId& notifier_id) const override; |
36 virtual void OnNotifierAdvancedSettingsRequested( | 35 void OnNotifierAdvancedSettingsRequested( |
37 const NotifierId& notifier_id, | 36 const NotifierId& notifier_id, |
38 const std::string* notification_id) override; | 37 const std::string* notification_id) override; |
39 virtual void AddObserver(NotifierSettingsObserver* observer) override; | 38 void AddObserver(NotifierSettingsObserver* observer) override; |
40 virtual void RemoveObserver(NotifierSettingsObserver* observer) override; | 39 void RemoveObserver(NotifierSettingsObserver* observer) override; |
41 | 40 |
42 bool WasEnabled(const Notifier& notifier); | 41 bool WasEnabled(const Notifier& notifier); |
43 int closed_called_count(); | 42 int closed_called_count(); |
44 | 43 |
45 void AddGroup(NotifierGroup* group, const std::vector<Notifier*>& notifiers); | 44 void AddGroup(NotifierGroup* group, const std::vector<Notifier*>& notifiers); |
46 | 45 |
47 // For testing, this method can be used to specify a notifier that has a learn | 46 // For testing, this method can be used to specify a notifier that has a learn |
48 // more button. This class only saves the last one that was set. | 47 // more button. This class only saves the last one that was set. |
49 void SetNotifierHasAdvancedSettings(const NotifierId& notifier_id); | 48 void SetNotifierHasAdvancedSettings(const NotifierId& notifier_id); |
50 size_t settings_requested_count() const; | 49 size_t settings_requested_count() const; |
(...skipping 11 matching lines...) Expand all Loading... |
62 std::vector<NotifierGroupItem> items_; | 61 std::vector<NotifierGroupItem> items_; |
63 int closed_called_count_; | 62 int closed_called_count_; |
64 size_t active_item_index_; | 63 size_t active_item_index_; |
65 scoped_ptr<NotifierId> notifier_id_with_settings_handler_; | 64 scoped_ptr<NotifierId> notifier_id_with_settings_handler_; |
66 size_t notifier_settings_requested_count_; | 65 size_t notifier_settings_requested_count_; |
67 }; | 66 }; |
68 | 67 |
69 } // namespace message_center | 68 } // namespace message_center |
70 | 69 |
71 #endif // UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ | 70 #endif // UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ |
OLD | NEW |