Index: content/shell/browser/shell_notification_manager.h |
diff --git a/content/shell/browser/shell_notification_manager.h b/content/shell/browser/shell_notification_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..53641843ead4473061dfd4d3df9318f473458b7a |
--- /dev/null |
+++ b/content/shell/browser/shell_notification_manager.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_SHELL_BROWSER_SHELL_NOTIFICATION_MANAGER_H_ |
+#define CONTENT_SHELL_BROWSER_SHELL_NOTIFICATION_MANAGER_H_ |
+ |
+#include <map> |
+ |
+#include "base/callback.h" |
+#include "third_party/WebKit/public/web/WebNotificationPresenter.h" |
+#include "url/gurl.h" |
+ |
+namespace content { |
+ |
+// Responsible for tracking active notifications and allowed origins for the |
+// Web Notification API when running layout tests. |
+class ShellNotificationManager { |
+ public: |
+ ShellNotificationManager(); |
+ ~ShellNotificationManager(); |
+ |
+ // Checks whether |origin| has permission to display notifications in tests. |
+ blink::WebNotificationPresenter::Permission CheckPermission( |
+ const GURL& origin); |
+ |
+ // Requests permission for |origin| to display notifications in layout tests. |
+ void RequestPermission(const GURL& origin, |
+ const base::Closure& callback); |
+ |
+ // Sets the permission to display notifications for |origin| to |permission|. |
+ void SetPermission(const GURL& origin, |
+ blink::WebNotificationPresenter::Permission permission); |
+ |
+ // Clears the currently granted permissions. |
+ void ClearPermissions(); |
+ |
+ private: |
+ typedef std::map<GURL, blink::WebNotificationPresenter::Permission> |
+ NotificationPermissionMap; |
+ NotificationPermissionMap permission_map_; |
+}; |
jochen (gone - plz use gerrit)
2014/07/17 09:29:45
disallow copy/assign
Peter Beverloo
2014/07/17 12:22:53
Done.
|
+ |
+} // content |
+ |
+#endif // CONTENT_SHELL_BROWSER_SHELL_NOTIFICATION_MANAGER_H_ |