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

Side by Side Diff: content/renderer/active_notification_tracker.cc

Issue 63253002: Rename WebKit namespace to blink (part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "third_party/WebKit/public/web/WebNotification.h" 9 #include "third_party/WebKit/public/web/WebNotification.h"
10 #include "third_party/WebKit/public/web/WebNotificationPermissionCallback.h" 10 #include "third_party/WebKit/public/web/WebNotificationPermissionCallback.h"
11 11
12 using WebKit::WebNotification; 12 using blink::WebNotification;
13 using WebKit::WebNotificationPermissionCallback; 13 using blink::WebNotificationPermissionCallback;
14 14
15 namespace content { 15 namespace content {
16 16
17 ActiveNotificationTracker::ActiveNotificationTracker() {} 17 ActiveNotificationTracker::ActiveNotificationTracker() {}
18 18
19 ActiveNotificationTracker::~ActiveNotificationTracker() {} 19 ActiveNotificationTracker::~ActiveNotificationTracker() {}
20 20
21 bool ActiveNotificationTracker::GetId( 21 bool ActiveNotificationTracker::GetId(
22 const WebNotification& notification, int& id) { 22 const WebNotification& notification, int& id) {
23 ReverseTable::iterator iter = reverse_notification_table_.find(notification); 23 ReverseTable::iterator iter = reverse_notification_table_.find(notification);
24 if (iter == reverse_notification_table_.end()) 24 if (iter == reverse_notification_table_.end())
25 return false; 25 return false;
26 id = iter->second; 26 id = iter->second;
27 return true; 27 return true;
28 } 28 }
29 29
30 bool ActiveNotificationTracker::GetNotification( 30 bool ActiveNotificationTracker::GetNotification(
31 int id, WebNotification* notification) { 31 int id, WebNotification* notification) {
32 WebNotification* lookup = notification_table_.Lookup(id); 32 WebNotification* lookup = notification_table_.Lookup(id);
33 if (!lookup) 33 if (!lookup)
34 return false; 34 return false;
35 35
36 *notification = *lookup; 36 *notification = *lookup;
37 return true; 37 return true;
38 } 38 }
39 39
40 int ActiveNotificationTracker::RegisterNotification( 40 int ActiveNotificationTracker::RegisterNotification(
41 const WebKit::WebNotification& proxy) { 41 const blink::WebNotification& proxy) {
42 if (reverse_notification_table_.find(proxy) 42 if (reverse_notification_table_.find(proxy)
43 != reverse_notification_table_.end()) { 43 != reverse_notification_table_.end()) {
44 return reverse_notification_table_[proxy]; 44 return reverse_notification_table_[proxy];
45 } else { 45 } else {
46 WebNotification* notification = new WebNotification(proxy); 46 WebNotification* notification = new WebNotification(proxy);
47 int id = notification_table_.Add(notification); 47 int id = notification_table_.Add(notification);
48 reverse_notification_table_[proxy] = id; 48 reverse_notification_table_[proxy] = id;
49 return id; 49 return id;
50 } 50 }
51 } 51 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 int ActiveNotificationTracker::RegisterPermissionRequest( 84 int ActiveNotificationTracker::RegisterPermissionRequest(
85 WebNotificationPermissionCallback* callback) { 85 WebNotificationPermissionCallback* callback) {
86 return callback_table_.Add(callback); 86 return callback_table_.Add(callback);
87 } 87 }
88 88
89 void ActiveNotificationTracker::OnPermissionRequestComplete(int id) { 89 void ActiveNotificationTracker::OnPermissionRequestComplete(int id) {
90 callback_table_.Remove(id); 90 callback_table_.Remove(id);
91 } 91 }
92 92
93 } // namespace content 93 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/active_notification_tracker.h ('k') | content/renderer/active_notification_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698