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

Side by Side Diff: chrome/browser/services/gcm/push_messaging_permission_context.h

Issue 718203004: [PUSH] Merge notifications and push messaging prompts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 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 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_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_
6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_ 6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_
7 7
8 #include "chrome/browser/content_settings/permission_context_base.h" 8 #include "chrome/browser/content_settings/permission_context_base.h"
9 9
10 #include "components/content_settings/core/common/content_settings_types.h"
11
12 class Profile;
13
10 namespace gcm { 14 namespace gcm {
11 15
12 // Permission context for push messages. 16 // Permission context for push messages.
13 class PushMessagingPermissionContext : public PermissionContextBase { 17 class PushMessagingPermissionContext : public PermissionContextBase {
14 public: 18 public:
15 explicit PushMessagingPermissionContext(Profile* profile); 19 explicit PushMessagingPermissionContext(Profile* profile);
16 ~PushMessagingPermissionContext() override; 20 ~PushMessagingPermissionContext() override;
17 21
22 ContentSetting GetPermissionStatus(
johnme 2014/11/13 18:50:06 Nit: Could you add a "// PermissionContextBase imp
Miguel Garcia 2014/11/14 11:34:36 Done.
23 const GURL& requesting_origin,
24 const GURL& embedding_origin) const override;
25
26 protected:
27 void DecidePermission(content::WebContents* web_contents,
28 const PermissionRequestID& id,
29 const GURL& requesting_origin,
30 const GURL& embedder_origin,
31 bool user_gesture,
32 const BrowserPermissionCallback& callback) override;
33
18 private: 34 private:
35 Profile* push_profile_;
Michael van Ouwerkerk 2014/11/13 18:35:52 PermissionContextBase already has this pointer. Wh
Miguel Garcia 2014/11/14 11:34:36 I don't think subclasses should this need in gener
36 ContentSettingsType push_setting_type_;
Michael van Ouwerkerk 2014/11/13 18:35:52 Why is this a member? It is always set to CONTENT_
Miguel Garcia 2014/11/14 11:34:36 Well, because if we ever change CONTENT_SETTINGS_T
Bernhard Bauer 2014/11/14 12:31:33 Couldn't you make it a constant declared in the .c
Miguel Garcia 2014/11/17 11:43:22 Done.
37
19 DISALLOW_COPY_AND_ASSIGN(PushMessagingPermissionContext); 38 DISALLOW_COPY_AND_ASSIGN(PushMessagingPermissionContext);
20 }; 39 };
21 40
22 } // namespace gcm 41 } // namespace gcm
23 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_ 42 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698