Chromium Code Reviews| Index: chrome/browser/ui/views/balloon_collection_impl_win.h |
| diff --git a/chrome/browser/ui/views/balloon_collection_impl_win.h b/chrome/browser/ui/views/balloon_collection_impl_win.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ed2e20492627cb970b1614291bd58d23e8f36561 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/balloon_collection_impl_win.h |
| @@ -0,0 +1,64 @@ |
| +// Copyright (c) 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 CHROME_BROWSER_UI_VIEWS_BALLOON_COLLECTION_IMPL_WIN_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_BALLOON_COLLECTION_IMPL_WIN_H_ |
| + |
| +#include <set> |
|
sky
2013/01/18 21:30:56
You don't use set in this file.
dewittj
2013/01/20 19:02:06
File gone.
|
| + |
| +#include "chrome/browser/notifications/balloon_collection_impl.h" |
| +#include "ui/message_center/message_center.h" |
| + |
| +namespace extensions { |
| +class Extension; |
| +} |
| + |
| +// Wrapper on top of ::BalloonCollectionImpl to provide integration between |
| +// the Chrome notification UI and Windows notifications |
| +// (ui::WebNotificationTrayWin). |
| +class BalloonCollectionImplWin |
| + : public BalloonCollectionImpl, |
| + public message_center::MessageCenter::Delegate { |
| + public: |
| + BalloonCollectionImplWin(); |
| + virtual ~BalloonCollectionImplWin(); |
| + |
| + // Overridden from BalloonCollectionImpl. |
| + virtual void Add(const Notification& notification, |
| + Profile* profile) OVERRIDE; |
| + virtual bool HasSpace() const OVERRIDE; |
| + |
| + // Overridden from MessageCenter::Delegate. |
| + virtual void NotificationRemoved(const std::string& notification_id) OVERRIDE; |
| + virtual void DisableExtension(const std::string& notification_id) OVERRIDE; |
| + virtual void DisableNotificationsFromSource( |
| + const std::string& notification_id) OVERRIDE; |
| + virtual void ShowSettings(const std::string& notification_id) OVERRIDE; |
| + virtual void OnClicked(const std::string& notification_id) OVERRIDE; |
| + virtual void OnButtonClicked(const std::string& notification_id, |
| + int button_index) OVERRIDE; |
| + |
|
Pete Williamson
2013/01/23 19:52:16
I see that balloon_collection_impl_ash.h has a fun
dewittj
2013/01/23 22:07:51
File gone.
|
| + // Updates the notification's content. It uses |
| + // NotificationDelegate::id() to check the equality of notifications. |
| + // Returns true if the notification has been updated. False if |
| + // no corresponding notification is found. This will not change the |
| + // visibility of the notification. |
| + bool UpdateNotification(const Notification& notification); |
| + |
| + // On Win this behaves the same as UpdateNotification. |
| + bool UpdateAndShowNotification(const Notification& notification); |
| + |
| + protected: |
| + // Creates a new balloon. Overridable by unit tests. The caller is |
| + // responsible for freeing the pointer returned. |
| + virtual Balloon* MakeBalloon(const Notification& notification, |
| + Profile* profile) OVERRIDE; |
| + |
| + const extensions::Extension* GetBalloonExtension(Balloon* balloon); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(BalloonCollectionImplWin); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_BALLOON_COLLECTION_IMPL_WIN_H_ |