OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/common/desktop_notifications/active_notification_tracker.h" | 5 #include "chrome/common/desktop_notifications/active_notification_tracker.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/scoped_ptr.h" | |
9 #include "third_party/WebKit/WebKit/chromium/public/WebNotification.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebNotification.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPermissionCal
lback.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPermissionCal
lback.h" |
11 | 10 |
12 using WebKit::WebNotification; | 11 using WebKit::WebNotification; |
13 using WebKit::WebNotificationPermissionCallback; | 12 using WebKit::WebNotificationPermissionCallback; |
14 | 13 |
15 bool ActiveNotificationTracker::GetId( | 14 bool ActiveNotificationTracker::GetId( |
16 const WebNotification& notification, int& id) { | 15 const WebNotification& notification, int& id) { |
17 ReverseTable::iterator iter = reverse_notification_table_.find(notification); | 16 ReverseTable::iterator iter = reverse_notification_table_.find(notification); |
18 if (iter == reverse_notification_table_.end()) | 17 if (iter == reverse_notification_table_.end()) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 60 } |
62 | 61 |
63 int ActiveNotificationTracker::RegisterPermissionRequest( | 62 int ActiveNotificationTracker::RegisterPermissionRequest( |
64 WebNotificationPermissionCallback* callback) { | 63 WebNotificationPermissionCallback* callback) { |
65 return callback_table_.Add(callback); | 64 return callback_table_.Add(callback); |
66 } | 65 } |
67 | 66 |
68 void ActiveNotificationTracker::OnPermissionRequestComplete(int id) { | 67 void ActiveNotificationTracker::OnPermissionRequestComplete(int id) { |
69 callback_table_.Remove(id); | 68 callback_table_.Remove(id); |
70 } | 69 } |
OLD | NEW |