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

Unified Diff: chrome/common/desktop_notifications/active_notification_tracker.h

Issue 6677096: Move a bunch of files from chrome\common to content\common. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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/common/desktop_notifications/active_notification_tracker.h
===================================================================
--- chrome/common/desktop_notifications/active_notification_tracker.h (revision 78451)
+++ chrome/common/desktop_notifications/active_notification_tracker.h (working copy)
@@ -1,58 +0,0 @@
-// 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_COMMON_DESKTOP_NOTIFICATIONS_ACTIVE_NOTIFICATION_TRACKER_H_
-#define CHROME_COMMON_DESKTOP_NOTIFICATIONS_ACTIVE_NOTIFICATION_TRACKER_H_
-#pragma once
-
-#include <map>
-
-#include "base/basictypes.h"
-#include "base/id_map.h"
-#include "base/hash_tables.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebNotification.h"
-
-namespace WebKit {
-class WebNotificationPermissionCallback;
-}
-
-// This class manages the set of active Notification objects in either
-// a render or worker process. This class should be accessed only on
-// the main thread.
-class ActiveNotificationTracker {
- public:
- ActiveNotificationTracker();
- ~ActiveNotificationTracker();
-
- // Methods for tracking active notification objects.
- int RegisterNotification(const WebKit::WebNotification& notification);
- void UnregisterNotification(int id);
- bool GetId(const WebKit::WebNotification& notification, int& id);
- bool GetNotification(int id, WebKit::WebNotification* notification);
-
- // Methods for tracking active permission requests.
- int RegisterPermissionRequest(
- WebKit::WebNotificationPermissionCallback* callback);
- void OnPermissionRequestComplete(int id);
- WebKit::WebNotificationPermissionCallback* GetCallback(int id);
-
- // Clears out all active notifications. Useful on page navigation.
- void Clear();
-
- // Detaches all active notifications from their presenter. Necessary
- // when the Presenter is destroyed.
- void DetachAll();
-
- private:
- typedef std::map<WebKit::WebNotification, int> ReverseTable;
-
- // Tracking maps for active notifications and permission requests.
- IDMap<WebKit::WebNotification> notification_table_;
- ReverseTable reverse_notification_table_;
- IDMap<WebKit::WebNotificationPermissionCallback> callback_table_;
-
- DISALLOW_COPY_AND_ASSIGN(ActiveNotificationTracker);
-};
-
-#endif // CHROME_COMMON_DESKTOP_NOTIFICATIONS_ACTIVE_NOTIFICATION_TRACKER_H_
« no previous file with comments | « chrome/common/common_param_traits_unittest.cc ('k') | chrome/common/desktop_notifications/active_notification_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698