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

Side by Side Diff: content/child/notifications/notification_manager.cc

Issue 1901133002: Move the notification constants to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « content/child/notifications/notification_manager.h ('k') | content/common/OWNERS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/child/notifications/notification_manager.h" 5 #include "content/child/notifications/notification_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "base/threading/thread_local.h" 12 #include "base/threading/thread_local.h"
13 #include "content/child/notifications/notification_data_conversions.h" 13 #include "content/child/notifications/notification_data_conversions.h"
14 #include "content/child/notifications/notification_dispatcher.h" 14 #include "content/child/notifications/notification_dispatcher.h"
15 #include "content/child/service_worker/web_service_worker_registration_impl.h" 15 #include "content/child/service_worker/web_service_worker_registration_impl.h"
16 #include "content/child/thread_safe_sender.h" 16 #include "content/child/thread_safe_sender.h"
17 #include "content/common/notification_constants.h"
18 #include "content/public/common/notification_resources.h" 17 #include "content/public/common/notification_resources.h"
19 #include "content/public/common/platform_notification_data.h" 18 #include "content/public/common/platform_notification_data.h"
20 #include "third_party/WebKit/public/platform/URLConversion.h" 19 #include "third_party/WebKit/public/platform/URLConversion.h"
21 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" 20 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
22 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati onDelegate.h" 21 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati onDelegate.h"
23 22
24 using blink::WebNotificationPermission; 23 using blink::WebNotificationPermission;
25 24
26 namespace content { 25 namespace content {
27 namespace { 26 namespace {
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 blink::WebNotificationPermissionAllowed; 217 blink::WebNotificationPermissionAllowed;
219 // TODO(mkwst): This is potentially doing the wrong thing with unique 218 // TODO(mkwst): This is potentially doing the wrong thing with unique
220 // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See 219 // origins. Perhaps also 'file:', 'blob:' and 'filesystem:'. See
221 // https://crbug.com/490074 for detail. 220 // https://crbug.com/490074 for detail.
222 thread_safe_sender_->Send(new PlatformNotificationHostMsg_CheckPermission( 221 thread_safe_sender_->Send(new PlatformNotificationHostMsg_CheckPermission(
223 blink::WebStringToGURL(origin.toString()), &permission)); 222 blink::WebStringToGURL(origin.toString()), &permission));
224 223
225 return permission; 224 return permission;
226 } 225 }
227 226
228 size_t NotificationManager::maxActions() {
229 return kPlatformNotificationMaxActions;
230 }
231
232 bool NotificationManager::OnMessageReceived(const IPC::Message& message) { 227 bool NotificationManager::OnMessageReceived(const IPC::Message& message) {
233 bool handled = true; 228 bool handled = true;
234 IPC_BEGIN_MESSAGE_MAP(NotificationManager, message) 229 IPC_BEGIN_MESSAGE_MAP(NotificationManager, message)
235 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidShow, OnDidShow); 230 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidShow, OnDidShow);
236 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidShowPersistent, 231 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidShowPersistent,
237 OnDidShowPersistent) 232 OnDidShowPersistent)
238 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidClose, OnDidClose); 233 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidClose, OnDidClose);
239 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidClick, OnDidClick); 234 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidClick, OnDidClick);
240 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidGetNotifications, 235 IPC_MESSAGE_HANDLER(PlatformNotificationMsg_DidGetNotifications,
241 OnDidGetNotifications) 236 OnDidGetNotifications)
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 301
307 notifications[i] = web_notification_info; 302 notifications[i] = web_notification_info;
308 } 303 }
309 304
310 callbacks->onSuccess(notifications); 305 callbacks->onSuccess(notifications);
311 306
312 pending_get_notification_requests_.Remove(request_id); 307 pending_get_notification_requests_.Remove(request_id);
313 } 308 }
314 309
315 } // namespace content 310 } // namespace content
OLDNEW
« no previous file with comments | « content/child/notifications/notification_manager.h ('k') | content/common/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698