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.
5 #include "content/shell/browser/shell_notification_manager.h"
9 ShellNotificationManager::ShellNotificationManager() {}
11 ShellNotificationManager::~ShellNotificationManager() {}
13 blink::WebNotificationPermission
14 ShellNotificationManager::CheckPermission(const GURL
& origin
) {
15 NotificationPermissionMap::iterator iter
=
16 permission_map_
.find(origin
);
17 if (iter
== permission_map_
.end())
18 return blink::WebNotificationPermissionDefault
;
23 void ShellNotificationManager::RequestPermission(
25 const base::Callback
<void(blink::WebNotificationPermission
)>& callback
) {
26 callback
.Run(CheckPermission(origin
));
29 void ShellNotificationManager::SetPermission(
31 blink::WebNotificationPermission permission
) {
32 permission_map_
[origin
] = permission
;
35 void ShellNotificationManager::ClearPermissions() {
36 permission_map_
.clear();
39 } // namespace content