| 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 virtual ~FakeNotifierSettingsProvider(); |
| 21 | 21 |
| 22 virtual size_t GetNotifierGroupCount() const OVERRIDE; | 22 virtual size_t GetNotifierGroupCount() const override; |
| 23 virtual const NotifierGroup& GetNotifierGroupAt(size_t index) const OVERRIDE; | 23 virtual const NotifierGroup& GetNotifierGroupAt(size_t index) const override; |
| 24 virtual bool IsNotifierGroupActiveAt(size_t index) const OVERRIDE; | 24 virtual bool IsNotifierGroupActiveAt(size_t index) const override; |
| 25 virtual void SwitchToNotifierGroup(size_t index) OVERRIDE; | 25 virtual void SwitchToNotifierGroup(size_t index) override; |
| 26 virtual const NotifierGroup& GetActiveNotifierGroup() const OVERRIDE; | 26 virtual const NotifierGroup& GetActiveNotifierGroup() const override; |
| 27 | 27 |
| 28 virtual void GetNotifierList(std::vector<Notifier*>* notifiers) OVERRIDE; | 28 virtual void GetNotifierList(std::vector<Notifier*>* notifiers) override; |
| 29 | 29 |
| 30 virtual void SetNotifierEnabled(const Notifier& notifier, | 30 virtual void SetNotifierEnabled(const Notifier& notifier, |
| 31 bool enabled) OVERRIDE; | 31 bool enabled) override; |
| 32 | 32 |
| 33 virtual void OnNotifierSettingsClosing() OVERRIDE; | 33 virtual void OnNotifierSettingsClosing() override; |
| 34 virtual bool NotifierHasAdvancedSettings(const NotifierId& notifier_id) const | 34 virtual bool NotifierHasAdvancedSettings(const NotifierId& notifier_id) const |
| 35 OVERRIDE; | 35 override; |
| 36 virtual void OnNotifierAdvancedSettingsRequested( | 36 virtual void OnNotifierAdvancedSettingsRequested( |
| 37 const NotifierId& notifier_id, | 37 const NotifierId& notifier_id, |
| 38 const std::string* notification_id) OVERRIDE; | 38 const std::string* notification_id) override; |
| 39 virtual void AddObserver(NotifierSettingsObserver* observer) OVERRIDE; | 39 virtual void AddObserver(NotifierSettingsObserver* observer) override; |
| 40 virtual void RemoveObserver(NotifierSettingsObserver* observer) OVERRIDE; | 40 virtual void RemoveObserver(NotifierSettingsObserver* observer) override; |
| 41 | 41 |
| 42 bool WasEnabled(const Notifier& notifier); | 42 bool WasEnabled(const Notifier& notifier); |
| 43 int closed_called_count(); | 43 int closed_called_count(); |
| 44 | 44 |
| 45 void AddGroup(NotifierGroup* group, const std::vector<Notifier*>& notifiers); | 45 void AddGroup(NotifierGroup* group, const std::vector<Notifier*>& notifiers); |
| 46 | 46 |
| 47 // For testing, this method can be used to specify a notifier that has a learn | 47 // 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. | 48 // more button. This class only saves the last one that was set. |
| 49 void SetNotifierHasAdvancedSettings(const NotifierId& notifier_id); | 49 void SetNotifierHasAdvancedSettings(const NotifierId& notifier_id); |
| 50 size_t settings_requested_count() const; | 50 size_t settings_requested_count() const; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 62 std::vector<NotifierGroupItem> items_; | 62 std::vector<NotifierGroupItem> items_; |
| 63 int closed_called_count_; | 63 int closed_called_count_; |
| 64 size_t active_item_index_; | 64 size_t active_item_index_; |
| 65 scoped_ptr<NotifierId> notifier_id_with_settings_handler_; | 65 scoped_ptr<NotifierId> notifier_id_with_settings_handler_; |
| 66 size_t notifier_settings_requested_count_; | 66 size_t notifier_settings_requested_count_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace message_center | 69 } // namespace message_center |
| 70 | 70 |
| 71 #endif // UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ | 71 #endif // UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ |
| OLD | NEW |