blob: f2c5cd7b8ecf5044ca021fb81e7570761de26ad9 [file] [log] [blame]
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +01001// 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
10namespace 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.
14class FakeNotifierSettingsProvider : public NotifierSettingsProvider {
15 public:
16 FakeNotifierSettingsProvider(const std::vector<Notifier*>& notifiers);
Ben Murdochbb1529c2013-08-08 10:24:53 +010017 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)868fa2f2013-06-11 10:57:03 +010025
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 Murdocheb525c52013-07-10 11:40:50 +010032 virtual void AddObserver(NotifierSettingsObserver* observer) OVERRIDE;
33 virtual void RemoveObserver(NotifierSettingsObserver* observer) OVERRIDE;
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +010034
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 Murdochbb1529c2013-08-08 10:24:53 +010041 const NotifierGroup notifier_group_;
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +010042 int closed_called_count_;
43};
44
45} // namespace message_center
46
47#endif // UI_MESSAGE_CENTER_FAKE_NOTIFIER_SETTINGS_PROVIDER_H_