| 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_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/containers/scoped_ptr_hash_map.h" | 9 #include "base/containers/scoped_ptr_hash_map.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // Store the decided permission as a content setting. | 120 // Store the decided permission as a content setting. |
| 121 // virtual since the permission might be stored with different restrictions | 121 // virtual since the permission might be stored with different restrictions |
| 122 // (for example for desktop notifications). | 122 // (for example for desktop notifications). |
| 123 virtual void UpdateContentSetting(const GURL& requesting_origin, | 123 virtual void UpdateContentSetting(const GURL& requesting_origin, |
| 124 const GURL& embedding_origin, | 124 const GURL& embedding_origin, |
| 125 ContentSetting content_setting); | 125 ContentSetting content_setting); |
| 126 | 126 |
| 127 // Whether the permission should be restricted to secure origins. | 127 // Whether the permission should be restricted to secure origins. |
| 128 virtual bool IsRestrictedToSecureOrigins() const = 0; | 128 virtual bool IsRestrictedToSecureOrigins() const = 0; |
| 129 | 129 |
| 130 // Whether the kill switch has been enabled for this API. |
| 131 virtual bool IsApiKillSwitchOn() const; |
| 132 |
| 130 private: | 133 private: |
| 131 // Called when a bubble is no longer used so it can be cleaned up. | 134 // Called when a bubble is no longer used so it can be cleaned up. |
| 132 void CleanUpBubble(const PermissionRequestID& id); | 135 void CleanUpBubble(const PermissionRequestID& id); |
| 133 | 136 |
| 134 Profile* profile_; | 137 Profile* profile_; |
| 135 const ContentSettingsType permission_type_; | 138 const ContentSettingsType permission_type_; |
| 136 scoped_ptr<PermissionQueueController> permission_queue_controller_; | 139 scoped_ptr<PermissionQueueController> permission_queue_controller_; |
| 137 base::ScopedPtrHashMap<std::string, scoped_ptr<PermissionBubbleRequest>> | 140 base::ScopedPtrHashMap<std::string, scoped_ptr<PermissionBubbleRequest>> |
| 138 pending_bubbles_; | 141 pending_bubbles_; |
| 139 | 142 |
| 140 // Must be the last member, to ensure that it will be | 143 // Must be the last member, to ensure that it will be |
| 141 // destroyed first, which will invalidate weak pointers | 144 // destroyed first, which will invalidate weak pointers |
| 142 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 145 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
| 143 }; | 146 }; |
| 144 | 147 |
| 145 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 148 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
| OLD | NEW |