blob: 19ced60c2ee088f6a684b714eacc9b1f68fd0bbb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_
#define UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_
#include "ui/message_center/message_center.h"
namespace message_center {
class NotificationDelegate;
// MessageCenter implementation of doing nothing. Useful for tests.
class FakeMessageCenter : public MessageCenter {
public:
FakeMessageCenter();
virtual ~FakeMessageCenter();
// Overridden from FakeMessageCenter.
virtual void SetDelegate(Delegate* delegate) OVERRIDE;
virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE;
virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE;
virtual size_t NotificationCount() const OVERRIDE;
virtual size_t UnreadNotificationCount() const OVERRIDE;
virtual bool HasPopupNotifications() const OVERRIDE;
virtual bool HasNotification(const std::string& id) OVERRIDE;
virtual bool IsQuietMode() const OVERRIDE;
virtual bool HasClickedListener(const std::string& id) OVERRIDE;
virtual const NotificationList::Notifications& GetNotifications() OVERRIDE;
virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE;
virtual void AddNotification(scoped_ptr<Notification> notification) OVERRIDE;
virtual void UpdateNotification(const std::string& old_id,
scoped_ptr<Notification> new_notification)
OVERRIDE;
virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE;
virtual void RemoveAllNotifications(bool by_user) OVERRIDE;
virtual void SetNotificationIcon(const std::string& notification_id,
const gfx::Image& image) OVERRIDE;
virtual void SetNotificationImage(const std::string& notification_id,
const gfx::Image& image) OVERRIDE;
virtual void SetNotificationButtonIcon(const std::string& notification_id,
int button_index,
const gfx::Image& image) OVERRIDE;
virtual void DisableNotificationsByExtension(const std::string& id) OVERRIDE;
virtual void DisableNotificationsByUrl(const std::string& id) OVERRIDE;
virtual void ShowNotificationSettings(const std::string& id) OVERRIDE;
virtual NotifierSettingsDelegate* ShowNotificationSettingsDialog(
gfx::NativeView context) OVERRIDE;
virtual void ExpandNotification(const std::string& id) OVERRIDE;
virtual void ClickOnNotification(const std::string& id) OVERRIDE;
virtual void ClickOnNotificationButton(const std::string& id,
int button_index) OVERRIDE;
virtual void MarkSinglePopupAsShown(const std::string& id,
bool mark_notification_as_read) OVERRIDE;
virtual void DisplayedNotification(const std::string& id) OVERRIDE;
virtual void SetQuietMode(bool in_quiet_mode) OVERRIDE;
virtual void EnterQuietModeWithExpire(
const base::TimeDelta& expires_in) OVERRIDE;
virtual void SetMessageCenterVisible(bool visible) OVERRIDE;
virtual bool IsMessageCenterVisible() OVERRIDE;
virtual void RestartPopupTimers() OVERRIDE;
virtual void PausePopupTimers() OVERRIDE;
protected:
virtual void DisableTimersForTest() OVERRIDE;
private:
const NotificationList::Notifications empty_notifications_;
DISALLOW_COPY_AND_ASSIGN(FakeMessageCenter);
};
} // namespace message_center
#endif // UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_
|