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

Unified Diff: chrome/browser/notifications/notification_ui_manager.h

Issue 208068: Desktop Notifications UI (for windows) (Closed)
Patch Set: Created 11 years, 3 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/notifications/notification_ui_manager.h
diff --git a/chrome/browser/notifications/notification_ui_manager.h b/chrome/browser/notifications/notification_ui_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..b76d8ab8aa04a75f9f1ece935c164a049fd4ee84
--- /dev/null
+++ b/chrome/browser/notifications/notification_ui_manager.h
@@ -0,0 +1,61 @@
+// Copyright (c) 2009 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_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_
+#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_H_
+
+#include <deque>
+
+#include "base/id_map.h"
+#include "base/scoped_ptr.h"
+#include "chrome/browser/notifications/balloons.h"
+
+class Notification;
+class Profile;
+class QueuedNotification;
+class SiteInstance;
+
+typedef std::deque<QueuedNotification*> NotificationDeque;
+
+// The notification manager is a singleton class which manages
+// all aspects of using the desktop for notifications. It maintains
+// a queue of pending notifications when space becomes constrained.
+class NotificationUIManager : public BalloonCollectionObserver {
+ public:
+ ~NotificationUIManager();
+
+ static NotificationUIManager* Create();
+
+ void Initialize(BalloonCollectionInterface* balloon_collection);
+
+ // Adds a notification to be displayed.
+ void Add(const Notification& notification,
+ Profile* profile, SiteInstance* site_instance);
+
+ // BalloonCollectionObserver implementation.
+ virtual void OnBalloonSpaceChanged();
+
+ private:
+ NotificationUIManager()
+ : balloons_observer_(NULL),
+ balloon_collection_(NULL) {
+ }
+
+ // Attempts to display notifications from the show_queue if the user
+ // is active.
+ void CheckAndShowNotifications();
+
+ // Attempts to display notifications from the show_queue.
+ void ShowNotifications();
+
+ BalloonCollectionObserver* balloons_observer_;
+ scoped_ptr<BalloonCollectionInterface> balloon_collection_;
+ NotificationDeque show_queue_;
+
+ IDMap<NotificationObjectProxy> proxy_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(NotificationUIManager);
+};
+
+#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_MANAGER_H_
« no previous file with comments | « chrome/browser/notifications/notification_object_proxy.cc ('k') | chrome/browser/notifications/notification_ui_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698