Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Unified Diff: chrome/browser/ui/views/balloon_collection_impl_win.h

Issue 11819048: Implement message center on Windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Now with more tests, and corrected copyright notices. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698