| 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_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ |
| 6 #define CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const PermissionRequestID& id, | 62 const PermissionRequestID& id, |
| 63 const GURL& requesting_frame, | 63 const GURL& requesting_frame, |
| 64 bool user_gesture, | 64 bool user_gesture, |
| 65 const BrowserPermissionCallback& callback); | 65 const BrowserPermissionCallback& callback); |
| 66 | 66 |
| 67 // Returns whether the permission has been granted, denied... | 67 // Returns whether the permission has been granted, denied... |
| 68 virtual ContentSetting GetPermissionStatus( | 68 virtual ContentSetting GetPermissionStatus( |
| 69 const GURL& requesting_origin, | 69 const GURL& requesting_origin, |
| 70 const GURL& embedding_origin) const; | 70 const GURL& embedding_origin) const; |
| 71 | 71 |
| 72 // Revokes the permission and returns the new content setting value for it. |
| 73 virtual ContentSetting RevokePermission( |
| 74 const GURL& requesting_origin, |
| 75 const GURL& embedding_origin); |
| 76 |
| 72 // Withdraw an existing permission request, no op if the permission request | 77 // Withdraw an existing permission request, no op if the permission request |
| 73 // was already cancelled by some other means. | 78 // was already cancelled by some other means. |
| 74 virtual void CancelPermissionRequest(content::WebContents* web_contents, | 79 virtual void CancelPermissionRequest(content::WebContents* web_contents, |
| 75 const PermissionRequestID& id); | 80 const PermissionRequestID& id); |
| 76 | 81 |
| 77 protected: | 82 protected: |
| 78 // Decide whether the permission should be granted. | 83 // Decide whether the permission should be granted. |
| 79 // Calls PermissionDecided if permission can be decided non-interactively, | 84 // Calls PermissionDecided if permission can be decided non-interactively, |
| 80 // or NotifyPermissionSet if permission decided by presenting an infobar. | 85 // or NotifyPermissionSet if permission decided by presenting an infobar. |
| 81 virtual void DecidePermission(content::WebContents* web_contents, | 86 virtual void DecidePermission(content::WebContents* web_contents, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 scoped_ptr<PermissionQueueController> permission_queue_controller_; | 133 scoped_ptr<PermissionQueueController> permission_queue_controller_; |
| 129 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> | 134 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> |
| 130 pending_bubbles_; | 135 pending_bubbles_; |
| 131 | 136 |
| 132 // Must be the last member, to ensure that it will be | 137 // Must be the last member, to ensure that it will be |
| 133 // destroyed first, which will invalidate weak pointers | 138 // destroyed first, which will invalidate weak pointers |
| 134 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 139 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
| 135 }; | 140 }; |
| 136 | 141 |
| 137 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ | 142 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ |
| OLD | NEW |