Chromium Code Reviews| 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_REQUEST_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 | 63 |
| 64 // Cancels an outstanding request. This may have different effects depending | 64 // Cancels an outstanding request. This may have different effects depending |
| 65 // on what is going on with the bubble. If the request is pending, it will be | 65 // on what is going on with the bubble. If the request is pending, it will be |
| 66 // removed and never shown. If the request is showing, it will continue to be | 66 // removed and never shown. If the request is showing, it will continue to be |
| 67 // shown, but the user's action won't be reported back to the request object. | 67 // shown, but the user's action won't be reported back to the request object. |
| 68 // In some circumstances, we can remove the request from the bubble, and may | 68 // In some circumstances, we can remove the request from the bubble, and may |
| 69 // do so. The request will have RequestFinished executed on it if it is found, | 69 // do so. The request will have RequestFinished executed on it if it is found, |
| 70 // at which time the caller is free to delete the request. | 70 // at which time the caller is free to delete the request. |
| 71 void CancelRequest(PermissionRequest* request); | 71 void CancelRequest(PermissionRequest* request); |
| 72 | 72 |
| 73 // Hides the bubble. | 73 // Dismisses the bubble if it is visible, as if the user had clicked the X in |
| 74 // the prompt. Then hides the bubble and destroys the UI surface used to | |
| 75 // display permission requests. | |
|
raymes
2016/10/26 04:59:11
Could you add a note here that this is only used o
dominickn
2016/10/26 05:54:23
I don't want to do that yet, because at some point
raymes
2016/10/27 01:42:57
Can we add a TODO to that effect then, with a bug
| |
| 76 void DismissBubble(); | |
| 77 | |
| 78 // Temporarily hides the bubble, and destroys the prompt UI surface. Any | |
| 79 // existing requests will be reshown when DisplayPendingRequests is called | |
| 80 // (e.g. when switching tabs away and back to a page with a prompt). | |
| 74 void HideBubble(); | 81 void HideBubble(); |
| 75 | 82 |
| 76 // Will show a permission bubble if there is a pending permission request on | 83 // Will show a permission bubble if there is a pending permission request on |
| 77 // the web contents that the PermissionRequestManager belongs to. | 84 // the web contents that the PermissionRequestManager belongs to. |
| 78 void DisplayPendingRequests(); | 85 void DisplayPendingRequests(); |
| 79 | 86 |
| 80 // Will reposition the bubble (may change parent if necessary). | 87 // Will reposition the bubble (may change parent if necessary). |
| 81 void UpdateAnchorPosition(); | 88 void UpdateAnchorPosition(); |
| 82 | 89 |
| 83 // True if a permission bubble is currently visible. | 90 // True if a permission bubble is currently visible. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 // Whether each of the requests in |requests_| is accepted by the user. | 200 // Whether each of the requests in |requests_| is accepted by the user. |
| 194 std::vector<bool> accept_states_; | 201 std::vector<bool> accept_states_; |
| 195 | 202 |
| 196 base::ObserverList<Observer> observer_list_; | 203 base::ObserverList<Observer> observer_list_; |
| 197 AutoResponseType auto_response_for_test_; | 204 AutoResponseType auto_response_for_test_; |
| 198 | 205 |
| 199 base::WeakPtrFactory<PermissionRequestManager> weak_factory_; | 206 base::WeakPtrFactory<PermissionRequestManager> weak_factory_; |
| 200 }; | 207 }; |
| 201 | 208 |
| 202 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ | 209 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ |
| OLD | NEW |