Home | History | Annotate | Download | only in message_center
      1 // Copyright 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_MESSAGE_CENTER_H_
      6 #define UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_
      7 
      8 #include "ui/message_center/message_center.h"
      9 #include "ui/message_center/message_center_types.h"
     10 
     11 namespace message_center {
     12 
     13 class NotificationDelegate;
     14 
     15 // MessageCenter implementation of doing nothing. Useful for tests.
     16 class FakeMessageCenter : public MessageCenter {
     17  public:
     18   FakeMessageCenter();
     19   virtual ~FakeMessageCenter();
     20 
     21   // Overridden from FakeMessageCenter.
     22   virtual void AddObserver(MessageCenterObserver* observer) OVERRIDE;
     23   virtual void RemoveObserver(MessageCenterObserver* observer) OVERRIDE;
     24   virtual void AddNotificationBlocker(NotificationBlocker* blocker) OVERRIDE;
     25   virtual void RemoveNotificationBlocker(NotificationBlocker* blocker) OVERRIDE;
     26   virtual size_t NotificationCount() const OVERRIDE;
     27   virtual size_t UnreadNotificationCount() const OVERRIDE;
     28   virtual bool HasPopupNotifications() const OVERRIDE;
     29   virtual bool HasNotification(const std::string& id) OVERRIDE;
     30   virtual bool IsQuietMode() const OVERRIDE;
     31   virtual bool HasClickedListener(const std::string& id) OVERRIDE;
     32   virtual const NotificationList::Notifications& GetVisibleNotifications()
     33       OVERRIDE;
     34   virtual NotificationList::PopupNotifications GetPopupNotifications() OVERRIDE;
     35   virtual void AddNotification(scoped_ptr<Notification> notification) OVERRIDE;
     36   virtual void UpdateNotification(const std::string& old_id,
     37                                   scoped_ptr<Notification> new_notification)
     38       OVERRIDE;
     39 
     40   virtual void RemoveNotification(const std::string& id, bool by_user) OVERRIDE;
     41   virtual void RemoveAllNotifications(bool by_user) OVERRIDE;
     42   virtual void RemoveAllVisibleNotifications(bool by_user) OVERRIDE;
     43   virtual void SetNotificationIcon(const std::string& notification_id,
     44                                    const gfx::Image& image) OVERRIDE;
     45 
     46   virtual void SetNotificationImage(const std::string& notification_id,
     47                                     const gfx::Image& image) OVERRIDE;
     48 
     49   virtual void SetNotificationButtonIcon(const std::string& notification_id,
     50                                          int button_index,
     51                                          const gfx::Image& image) OVERRIDE;
     52   virtual void DisableNotificationsByNotifier(
     53       const NotifierId& notifier_id) OVERRIDE;
     54   virtual void ExpandNotification(const std::string& id) OVERRIDE;
     55   virtual void ClickOnNotification(const std::string& id) OVERRIDE;
     56   virtual void ClickOnNotificationButton(const std::string& id,
     57                                          int button_index) OVERRIDE;
     58   virtual void MarkSinglePopupAsShown(const std::string& id,
     59                                       bool mark_notification_as_read) OVERRIDE;
     60   virtual void DisplayedNotification(const std::string& id) OVERRIDE;
     61   virtual void SetNotifierSettingsProvider(
     62       NotifierSettingsProvider* provider) OVERRIDE;
     63   virtual NotifierSettingsProvider* GetNotifierSettingsProvider() OVERRIDE;
     64   virtual void SetQuietMode(bool in_quiet_mode) OVERRIDE;
     65   virtual void EnterQuietModeWithExpire(
     66       const base::TimeDelta& expires_in) OVERRIDE;
     67   virtual void SetVisibility(Visibility visible) OVERRIDE;
     68   virtual bool IsMessageCenterVisible() const OVERRIDE;
     69   virtual void RestartPopupTimers() OVERRIDE;
     70   virtual void PausePopupTimers() OVERRIDE;
     71 
     72  protected:
     73   virtual void DisableTimersForTest() OVERRIDE;
     74 
     75  private:
     76   const NotificationList::Notifications empty_notifications_;
     77 
     78   DISALLOW_COPY_AND_ASSIGN(FakeMessageCenter);
     79 };
     80 
     81 }  // namespace message_center
     82 
     83 #endif  // UI_MESSAGE_CENTER_FAKE_MESSAGE_CENTER_H_
     84