| 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 // Resets the permission to its default value. |
| 73 virtual void ResetPermission(const GURL& requesting_origin, |
| 74 const GURL& embedding_origin); |
| 75 |
| 72 // Withdraw an existing permission request, no op if the permission request | 76 // Withdraw an existing permission request, no op if the permission request |
| 73 // was already cancelled by some other means. | 77 // was already cancelled by some other means. |
| 74 virtual void CancelPermissionRequest(content::WebContents* web_contents, | 78 virtual void CancelPermissionRequest(content::WebContents* web_contents, |
| 75 const PermissionRequestID& id); | 79 const PermissionRequestID& id); |
| 76 | 80 |
| 77 protected: | 81 protected: |
| 78 // Decide whether the permission should be granted. | 82 // Decide whether the permission should be granted. |
| 79 // Calls PermissionDecided if permission can be decided non-interactively, | 83 // Calls PermissionDecided if permission can be decided non-interactively, |
| 80 // or NotifyPermissionSet if permission decided by presenting an infobar. | 84 // or NotifyPermissionSet if permission decided by presenting an infobar. |
| 81 virtual void DecidePermission(content::WebContents* web_contents, | 85 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_; | 132 scoped_ptr<PermissionQueueController> permission_queue_controller_; |
| 129 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> | 133 base::ScopedPtrHashMap<std::string, PermissionBubbleRequest> |
| 130 pending_bubbles_; | 134 pending_bubbles_; |
| 131 | 135 |
| 132 // Must be the last member, to ensure that it will be | 136 // Must be the last member, to ensure that it will be |
| 133 // destroyed first, which will invalidate weak pointers | 137 // destroyed first, which will invalidate weak pointers |
| 134 base::WeakPtrFactory<PermissionContextBase> weak_factory_; | 138 base::WeakPtrFactory<PermissionContextBase> weak_factory_; |
| 135 }; | 139 }; |
| 136 | 140 |
| 137 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ | 141 #endif // CHROME_BROWSER_CONTENT_SETTINGS_PERMISSION_CONTEXT_BASE_H_ |
| OLD | NEW |