| OLD | NEW |
| 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 // PermissionContextBase: |
| 23 ContentSetting GetPermissionStatus( |
| 24 const GURL& requesting_origin, |
| 25 const GURL& embedding_origin) const override; |
| 26 |
| 27 protected: |
| 28 // PermissionContextBase: |
| 29 void DecidePermission(content::WebContents* web_contents, |
| 30 const PermissionRequestID& id, |
| 31 const GURL& requesting_origin, |
| 32 const GURL& embedding_origin, |
| 33 bool user_gesture, |
| 34 const BrowserPermissionCallback& callback) override; |
| 35 |
| 18 private: | 36 private: |
| 37 Profile* push_profile_; |
| 38 const ContentSettingsType push_setting_type_; |
| 39 |
| 19 DISALLOW_COPY_AND_ASSIGN(PushMessagingPermissionContext); | 40 DISALLOW_COPY_AND_ASSIGN(PushMessagingPermissionContext); |
| 20 }; | 41 }; |
| 21 | 42 |
| 22 } // namespace gcm | 43 } // namespace gcm |
| 23 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_ | 44 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_PERMISSION_CONTEXT_H_ |
| OLD | NEW |