| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // examples. | 55 // examples. |
| 56 | 56 |
| 57 class PermissionContextBase : public KeyedService { | 57 class PermissionContextBase : public KeyedService { |
| 58 public: | 58 public: |
| 59 PermissionContextBase(Profile* profile, | 59 PermissionContextBase(Profile* profile, |
| 60 const content::PermissionType permission_type, | 60 const content::PermissionType permission_type, |
| 61 const ContentSettingsType content_settings_type); | 61 const ContentSettingsType content_settings_type); |
| 62 ~PermissionContextBase() override; | 62 ~PermissionContextBase() override; |
| 63 | 63 |
| 64 // A field trial used to enable the global permissions kill switch. | 64 // A field trial used to enable the global permissions kill switch. |
| 65 // This is public for testing purposes. | 65 // This is public so permissions that don't yet inherit from |
| 66 // PermissionContextBase can use it. |
| 66 static const char kPermissionsKillSwitchFieldStudy[]; | 67 static const char kPermissionsKillSwitchFieldStudy[]; |
| 67 | 68 |
| 68 // The field trial param to enable the global permissions kill switch. | 69 // The field trial param to enable the global permissions kill switch. |
| 69 // This is public for testing purposes. | 70 // This is public so permissions that don't yet inherit from |
| 71 // PermissionContextBase can use it. |
| 70 static const char kPermissionsKillSwitchBlockedValue[]; | 72 static const char kPermissionsKillSwitchBlockedValue[]; |
| 71 | 73 |
| 72 // The renderer is requesting permission to push messages. | 74 // The renderer is requesting permission to push messages. |
| 73 // When the answer to a permission request has been determined, |callback| | 75 // When the answer to a permission request has been determined, |callback| |
| 74 // should be called with the result. | 76 // should be called with the result. |
| 75 virtual void RequestPermission(content::WebContents* web_contents, | 77 virtual void RequestPermission(content::WebContents* web_contents, |
| 76 const PermissionRequestID& id, | 78 const PermissionRequestID& id, |
| 77 const GURL& requesting_frame, | 79 const GURL& requesting_frame, |
| 78 const BrowserPermissionCallback& callback); | 80 const BrowserPermissionCallback& callback); |
| 79 | 81 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 #endif | 164 #endif |
| 163 base::ScopedPtrHashMap<std::string, scoped_ptr<PermissionBubbleRequest>> | 165 base::ScopedPtrHashMap<std::string, scoped_ptr<PermissionBubbleRequest>> |
| 164 pending_bubbles_; | 166 pending_bubbles_; |
| 165 | 167 |
| 166 // Must be the last member, to ensure that it will be | 168 // Must be the last member, to ensure that it will be |
| 167 // destroyed first, which will invalidate weak pointers | 169 // destroyed first, which will invalidate weak pointers |
| 168 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 170 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
| 169 }; | 171 }; |
| 170 | 172 |
| 171 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ | 173 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_CONTEXT_BASE_H_ |
| OLD | NEW |