| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/notifications/notification_ui_manager.h" | 11 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 12 #include "chrome/browser/notifications/notification_ui_manager_impl.h" | 12 #include "chrome/browser/notifications/notification_ui_manager_impl.h" |
| 13 | 13 |
| 14 class Notification; | 14 class Notification; |
| 15 class Profile; | 15 class Profile; |
| 16 | 16 |
| 17 namespace message_center { |
| 18 class MessageCenter; |
| 19 } |
| 20 |
| 17 // This class extends NotificationUIManagerImpl and delegates actual display | 21 // This class extends NotificationUIManagerImpl and delegates actual display |
| 18 // of notifications to MessageCenter, doing necessary conversions. | 22 // of notifications to MessageCenter, doing necessary conversions. |
| 19 class MessageCenterNotificationManager : public NotificationUIManagerImpl { | 23 class MessageCenterNotificationManager : public NotificationUIManagerImpl { |
| 20 public: | 24 public: |
| 21 MessageCenterNotificationManager(); | 25 MessageCenterNotificationManager(); |
| 22 virtual ~MessageCenterNotificationManager(); | 26 virtual ~MessageCenterNotificationManager(); |
| 23 | 27 |
| 24 // NotificationUIManager: | 28 // NotificationUIManager: |
| 25 virtual bool CancelById(const std::string& notification_id) OVERRIDE; | 29 virtual bool CancelById(const std::string& notification_id) OVERRIDE; |
| 26 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE; | 30 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE; |
| 27 virtual bool CancelAllByProfile(Profile* profile) OVERRIDE; | 31 virtual bool CancelAllByProfile(Profile* profile) OVERRIDE; |
| 28 virtual void CancelAll() OVERRIDE; | 32 virtual void CancelAll() OVERRIDE; |
| 29 | 33 |
| 30 // NotificationUIManagerImpl: | 34 // NotificationUIManagerImpl: |
| 31 virtual bool ShowNotification(const Notification& notification, | 35 virtual bool ShowNotification(const Notification& notification, |
| 32 Profile* profile) OVERRIDE; | 36 Profile* profile) OVERRIDE; |
| 33 virtual bool UpdateNotification(const Notification& notification) OVERRIDE; | 37 virtual bool UpdateNotification(const Notification& notification) OVERRIDE; |
| 34 | 38 |
| 35 private: | 39 private: |
| 40 message_center::MessageCenter* message_center_; |
| 41 |
| 36 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager); | 42 DISALLOW_COPY_AND_ASSIGN(MessageCenterNotificationManager); |
| 37 }; | 43 }; |
| 38 | 44 |
| 39 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ | 45 #endif // CHROME_BROWSER_NOTIFICATIONS_MESSAGE_CENTER_NOTIFICATION_MANAGER_H_ |
| 40 | 46 |
| 41 | 47 |
| OLD | NEW |