Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ |
| 6 | #define UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ |
| 7 | |
| 8 | #include "ui/message_center/notifier_settings.h" |
| 9 | |
| 10 | namespace message_center { |
| 11 | |
| 12 | // A NotifierSettingsProvider that returns a configurable, fixed set of |
| 13 | // notifiers and records which callbacks were called. For use in tests. |
| 14 | class FakeNotifierSettingsProvider : public NotifierSettingsProvider { |
| 15 | public: |
| 16 | FakeNotifierSettingsProvider(const std::vector<Notifier*>& notifiers); |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 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; |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 25 | |
| 26 | virtual void GetNotifierList(std::vector<Notifier*>* notifiers) OVERRIDE; |
| 27 | |
| 28 | virtual void SetNotifierEnabled(const Notifier& notifier, |
| 29 | bool enabled) OVERRIDE; |
| 30 | |
| 31 | virtual void OnNotifierSettingsClosing() OVERRIDE; |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 32 | virtual void AddObserver(NotifierSettingsObserver* observer) OVERRIDE; |
| 33 | virtual void RemoveObserver(NotifierSettingsObserver* observer) OVERRIDE; |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 34 | |
| 35 | bool WasEnabled(const Notifier& notifier); |
| 36 | int closed_called_count(); |
| 37 | |
| 38 | private: |
| 39 | std::vector<Notifier*> notifiers_; |
| 40 | std::map<const Notifier*, bool> enabled_; |
Ben Murdoch | bb1529c | 2013-08-08 10:24:53 +0100 | [diff] [blame^] | 41 | const NotifierGroup notifier_group_; |
Torne (Richard Coles) | 868fa2f | 2013-06-11 10:57:03 +0100 | [diff] [blame] | 42 | int closed_called_count_; |
| 43 | }; |
| 44 | |
| 45 | } // namespace message_center |
| 46 | |
| 47 | #endif // UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_ |