Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #ifndef CONTENT_SHELL_BROWSER_SHELL_NOTIFICATION_MANAGER_H_ | |
| 6 #define CONTENT_SHELL_BROWSER_SHELL_NOTIFICATION_MANAGER_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "third_party/WebKit/public/web/WebNotificationPresenter.h" | |
| 12 #include "url/gurl.h" | |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 // Responsible for tracking active notifications and allowed origins for the | |
| 17 // Web Notification API when running layout tests. | |
| 18 class ShellNotificationManager { | |
| 19 public: | |
| 20 ShellNotificationManager(); | |
| 21 ~ShellNotificationManager(); | |
| 22 | |
| 23 // Checks whether |origin| has permission to display notifications in tests. | |
| 24 blink::WebNotificationPresenter::Permission CheckPermission( | |
| 25 const GURL& origin); | |
| 26 | |
| 27 // Requests permission for |origin| to display notifications in layout tests. | |
| 28 void RequestPermission(const GURL& origin, | |
| 29 const base::Closure& callback); | |
| 30 | |
| 31 // Sets the permission to display notifications for |origin| to |permission|. | |
| 32 void SetPermission(const GURL& origin, | |
| 33 blink::WebNotificationPresenter::Permission permission); | |
| 34 | |
| 35 // Clears the currently granted permissions. | |
| 36 void ClearPermissions(); | |
| 37 | |
| 38 private: | |
| 39 typedef std::map<GURL, blink::WebNotificationPresenter::Permission> | |
| 40 NotificationPermissionMap; | |
| 41 NotificationPermissionMap permission_map_; | |
| 42 }; | |
|
jochen (gone - plz use gerrit)
2014/07/17 09:29:45
disallow copy/assign
Peter Beverloo
2014/07/17 12:22:53
Done.
| |
| 43 | |
| 44 } // content | |
| 45 | |
| 46 #endif // CONTENT_SHELL_BROWSER_SHELL_NOTIFICATION_MANAGER_H_ | |
| OLD | NEW |