| 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_UI_VIEWS_ASH_BALLOON_COLLECTION_IMPL_ASH_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_COLLECTION_IMPL_ASH_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_COLLECTION_IMPL_ASH_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_COLLECTION_IMPL_ASH_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "ash/system/web_notification/web_notification_tray.h" | 10 #include "ash/system/web_notification/message_center.h" |
| 11 #include "chrome/browser/chromeos/notifications/balloon_view_host_chromeos.h" /
/ MessageCallback | 11 #include "chrome/browser/chromeos/notifications/balloon_view_host_chromeos.h" /
/ MessageCallback |
| 12 #include "chrome/browser/notifications/balloon_collection_impl.h" | 12 #include "chrome/browser/notifications/balloon_collection_impl.h" |
| 13 | 13 |
| 14 // Wrapper on top of ::BalloonCollectionImpl to provide integration between | 14 // Wrapper on top of ::BalloonCollectionImpl to provide integration between |
| 15 // the Chrome notification UI and Ash notifications (ash::WebNotificationTray). | 15 // the Chrome notification UI and Ash notifications (ash::WebNotificationTray). |
| 16 class BalloonCollectionImplAsh : public BalloonCollectionImpl, | 16 class BalloonCollectionImplAsh |
| 17 public ash::WebNotificationTray::Delegate { | 17 : public BalloonCollectionImpl, |
| 18 public message_center::MessageCenter::Delegate { |
| 18 public: | 19 public: |
| 19 BalloonCollectionImplAsh(); | 20 BalloonCollectionImplAsh(); |
| 20 virtual ~BalloonCollectionImplAsh(); | 21 virtual ~BalloonCollectionImplAsh(); |
| 21 | 22 |
| 22 // Overridden from BalloonCollectionImpl. | 23 // Overridden from BalloonCollectionImpl. |
| 23 virtual void Add(const Notification& notification, | 24 virtual void Add(const Notification& notification, |
| 24 Profile* profile) OVERRIDE; | 25 Profile* profile) OVERRIDE; |
| 25 virtual bool HasSpace() const OVERRIDE; | 26 virtual bool HasSpace() const OVERRIDE; |
| 26 | 27 |
| 27 // Overridden from WebNotificationTray::Delegate. | 28 // Overridden from MessageCenter::Delegate. |
| 28 virtual void NotificationRemoved(const std::string& notifcation_id) OVERRIDE; | 29 virtual void NotificationRemoved(const std::string& notifcation_id) OVERRIDE; |
| 29 virtual void DisableExtension(const std::string& notifcation_id) OVERRIDE; | 30 virtual void DisableExtension(const std::string& notifcation_id) OVERRIDE; |
| 30 virtual void DisableNotificationsFromSource( | 31 virtual void DisableNotificationsFromSource( |
| 31 const std::string& notifcation_id) OVERRIDE; | 32 const std::string& notifcation_id) OVERRIDE; |
| 32 virtual void ShowSettings(const std::string& notifcation_id) OVERRIDE; | 33 virtual void ShowSettings(const std::string& notifcation_id) OVERRIDE; |
| 33 virtual void OnClicked(const std::string& notifcation_id) OVERRIDE; | 34 virtual void OnClicked(const std::string& notifcation_id) OVERRIDE; |
| 34 | 35 |
| 35 // Adds a callback for WebUI message. Returns true if the callback | 36 // Adds a callback for WebUI message. Returns true if the callback |
| 36 // is succssfully registered, or false otherwise. It fails to add if | 37 // is succssfully registered, or false otherwise. It fails to add if |
| 37 // there is no notification that matches NotificationDelegate::id(), | 38 // there is no notification that matches NotificationDelegate::id(), |
| (...skipping 20 matching lines...) Expand all Loading... |
| 58 virtual Balloon* MakeBalloon(const Notification& notification, | 59 virtual Balloon* MakeBalloon(const Notification& notification, |
| 59 Profile* profile) OVERRIDE; | 60 Profile* profile) OVERRIDE; |
| 60 | 61 |
| 61 const extensions::Extension* GetBalloonExtension(Balloon* balloon); | 62 const extensions::Extension* GetBalloonExtension(Balloon* balloon); |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionImplAsh); | 65 DISALLOW_COPY_AND_ASSIGN(BalloonCollectionImplAsh); |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 #endif // CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_COLLECTION_IMPL_ASH_H_ | 68 #endif // CHROME_BROWSER_UI_VIEWS_ASH_BALLOON_COLLECTION_IMPL_ASH_H_ |
| OLD | NEW |