OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/active_notification_tracker.h" | 5 #include "content/renderer/active_notification_tracker.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotification.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotification.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPermis
sionCallback.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPermis
sionCallback.h" |
11 | 11 |
12 using WebKit::WebNotification; | 12 using WebKit::WebNotification; |
13 using WebKit::WebNotificationPermissionCallback; | 13 using WebKit::WebNotificationPermissionCallback; |
14 | 14 |
| 15 namespace content { |
| 16 |
15 ActiveNotificationTracker::ActiveNotificationTracker() {} | 17 ActiveNotificationTracker::ActiveNotificationTracker() {} |
16 | 18 |
17 ActiveNotificationTracker::~ActiveNotificationTracker() {} | 19 ActiveNotificationTracker::~ActiveNotificationTracker() {} |
18 | 20 |
19 bool ActiveNotificationTracker::GetId( | 21 bool ActiveNotificationTracker::GetId( |
20 const WebNotification& notification, int& id) { | 22 const WebNotification& notification, int& id) { |
21 ReverseTable::iterator iter = reverse_notification_table_.find(notification); | 23 ReverseTable::iterator iter = reverse_notification_table_.find(notification); |
22 if (iter == reverse_notification_table_.end()) | 24 if (iter == reverse_notification_table_.end()) |
23 return false; | 25 return false; |
24 id = iter->second; | 26 id = iter->second; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 82 } |
81 | 83 |
82 int ActiveNotificationTracker::RegisterPermissionRequest( | 84 int ActiveNotificationTracker::RegisterPermissionRequest( |
83 WebNotificationPermissionCallback* callback) { | 85 WebNotificationPermissionCallback* callback) { |
84 return callback_table_.Add(callback); | 86 return callback_table_.Add(callback); |
85 } | 87 } |
86 | 88 |
87 void ActiveNotificationTracker::OnPermissionRequestComplete(int id) { | 89 void ActiveNotificationTracker::OnPermissionRequestComplete(int id) { |
88 callback_table_.Remove(id); | 90 callback_table_.Remove(id); |
89 } | 91 } |
| 92 |
| 93 } // namespace content |
OLD | NEW |