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

Side by Side Diff: content/shell/browser/shell_notification_manager.cc

Issue 395883002: Support layout testing Web Notifications from Document and Worker contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/shell/browser/shell_notification_manager.h"
6
7 namespace content {
8
9 ShellNotificationManager::ShellNotificationManager() {}
10
11 ShellNotificationManager::~ShellNotificationManager() {}
12
13 blink::WebNotificationPresenter::Permission
14 ShellNotificationManager::CheckPermission(const GURL& origin) {
15 NotificationPermissionMap::iterator iter =
16 permission_map_.find(origin);
17 if (iter == permission_map_.end())
18 return blink::WebNotificationPresenter::PermissionNotAllowed;
19
20 return iter->second;
21 }
22
23 void ShellNotificationManager::RequestPermission(
24 const GURL& origin, const base::Closure& callback) {
25 // TODO(peter): The request's result should be passed to |callback|.
jochen (gone - plz use gerrit) 2014/07/17 09:29:45 should be easy to implement, no?
Peter Beverloo 2014/07/17 12:22:52 It requires changing the chrome/ implementation of
26 callback.Run();
27 }
28
29 void ShellNotificationManager::SetPermission(
30 const GURL& origin,
31 blink::WebNotificationPresenter::Permission permission) {
32 permission_map_[origin] = permission;
33 }
34
35 void ShellNotificationManager::ClearPermissions() {
36 permission_map_.clear();
37 }
38
39 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698