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

Unified Diff: chrome/browser/notifications/notification_permission_context.h

Issue 1207363002: Simplify permission-related code for Web Notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/notification_permission_context.h
diff --git a/chrome/browser/notifications/notification_permission_context.h b/chrome/browser/notifications/notification_permission_context.h
new file mode 100644
index 0000000000000000000000000000000000000000..41b3e637d94bc76380b0bb9b42f960fadf81c77e
--- /dev/null
+++ b/chrome/browser/notifications/notification_permission_context.h
@@ -0,0 +1,36 @@
+// Copyright 2015 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 CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PERMISSION_CONTEXT_H_
+#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PERMISSION_CONTEXT_H_
+
+#include "chrome/browser/content_settings/permission_context_base.h"
+#include "components/content_settings/core/common/content_settings.h"
+
+class GURL;
+class Profile;
+
+class NotificationPermissionContext : public PermissionContextBase {
+ public:
+ explicit NotificationPermissionContext(Profile* profile);
+ ~NotificationPermissionContext() override;
+
+ // PermissionContextBase implementation (public).
mlamouri (slow - plz ping) 2015/06/30 14:27:11 nit: I've never seen "(public)" being mentioned th
Peter Beverloo 2015/06/30 14:35:23 Done.
+ void ResetPermission(const GURL& requesting_origin,
+ const GURL& embedder_origin) override;
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(NotificationPermissionContextTest,
+ IgnoresEmbedderOrigin);
+ FRIEND_TEST_ALL_PREFIXES(NotificationPermissionContextTest,
+ NoSecureOriginRequirement);
mlamouri (slow - plz ping) 2015/06/30 14:27:11 I think having a NotificationPermissionContextTest
Peter Beverloo 2015/06/30 14:35:23 Acknowledged.
+
+ // PermissionContextBase implementation (private).
mlamouri (slow - plz ping) 2015/06/30 14:27:11 ditto.
Peter Beverloo 2015/06/30 14:35:23 Done.
+ void UpdateContentSetting(const GURL& requesting_origin,
+ const GURL& embedder_origin,
+ ContentSetting content_setting) override;
+ bool IsRestrictedToSecureOrigins() const override;
+};
+
+#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PERMISSION_CONTEXT_H_

Powered by Google App Engine
This is Rietveld 408576698