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

Side by Side Diff: chrome/browser/notifications/notification_permission_context.h

Issue 2908133003: Split GetPermissionStatus into GetPermissionStatusForFrame/Worker
Patch Set: Split GetPermissionStatus into GetPermissionStatusForFrame/Worker Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PERMISSION_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PERMISSION_CONTEXT_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PERMISSION_CONTEXT_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PERMISSION_CONTEXT_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "chrome/browser/permissions/permission_context_base.h" 9 #include "chrome/browser/permissions/permission_context_base.h"
10 #include "components/content_settings/core/common/content_settings.h" 10 #include "components/content_settings/core/common/content_settings.h"
11 11
12 class GURL; 12 class GURL;
13 class Profile; 13 class Profile;
14 14
15 class NotificationPermissionContext : public PermissionContextBase { 15 class NotificationPermissionContext : public PermissionContextBase {
16 public: 16 public:
17 NotificationPermissionContext(Profile* profile, ContentSettingsType); 17 NotificationPermissionContext(Profile* profile, ContentSettingsType);
18 ~NotificationPermissionContext() override; 18 ~NotificationPermissionContext() override;
19 19
20 // PermissionContextBase implementation. 20 // PermissionContextBase implementation.
21 ContentSetting GetPermissionStatusInternal( 21 ContentSetting GetPermissionStatusInternal(
22 content::RenderFrameHost* render_frame_host, 22 content::RenderFrameHost* render_frame_host,
23 const GURL& requesting_origin, 23 const GURL& requesting_origin,
24 const GURL& embedding_origin) const override; 24 const GURL& embedding_origin) const override;
25 void ResetPermission(const GURL& requesting_origin, 25 void ResetPermission(const GURL& requesting_origin,
26 const GURL& embedder_origin) override; 26 const GURL& embedder_origin) override;
27 void CancelPermissionRequest(content::WebContents* web_contents, 27 void CancelPermissionRequest(content::WebContents* web_contents,
28 const PermissionRequestID& id) override; 28 const PermissionRequestID& id) override;
29 bool IsAllowedInWorkers() const override;
29 30
30 private: 31 private:
31 friend class NotificationPermissionContextTest; 32 friend class NotificationPermissionContextTest;
32 33
33 // PermissionContextBase implementation. 34 // PermissionContextBase implementation.
34 void DecidePermission(content::WebContents* web_contents, 35 void DecidePermission(content::WebContents* web_contents,
35 const PermissionRequestID& id, 36 const PermissionRequestID& id,
36 const GURL& requesting_origin, 37 const GURL& requesting_origin,
37 const GURL& embedding_origin, 38 const GURL& embedding_origin,
38 bool user_gesture, 39 bool user_gesture,
39 const BrowserPermissionCallback& callback) override; 40 const BrowserPermissionCallback& callback) override;
40 void UpdateContentSetting(const GURL& requesting_origin, 41 void UpdateContentSetting(const GURL& requesting_origin,
41 const GURL& embedder_origin, 42 const GURL& embedder_origin,
42 ContentSetting content_setting) override; 43 ContentSetting content_setting) override;
43 bool IsRestrictedToSecureOrigins() const override; 44 bool IsRestrictedToSecureOrigins() const override;
44 45
45 base::WeakPtrFactory<NotificationPermissionContext> weak_factory_ui_thread_; 46 base::WeakPtrFactory<NotificationPermissionContext> weak_factory_ui_thread_;
46 }; 47 };
47 48
48 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PERMISSION_CONTEXT_H_ 49 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_PERMISSION_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698