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 <deque> | 8 #include <deque> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "chrome/browser/ui/permission_bubble/permission_prompt.h" | 14 #include "chrome/browser/ui/permission_bubble/permission_prompt.h" |
15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
16 #include "content/public/browser/web_contents_user_data.h" | 16 #include "content/public/browser/web_contents_user_data.h" |
17 | 17 |
| 18 enum class PermissionAction; |
18 class PermissionRequest; | 19 class PermissionRequest; |
19 | 20 |
20 namespace safe_browsing { | 21 namespace safe_browsing { |
21 class PermissionReporterBrowserTest; | 22 class PermissionReporterBrowserTest; |
22 } | 23 } |
23 | 24 |
24 namespace test { | 25 namespace test { |
25 class PermissionRequestManagerTestApi; | 26 class PermissionRequestManagerTestApi; |
26 } | 27 } |
27 | 28 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 151 |
151 // Shows the bubble for a request that has just been dequeued, or re-show a | 152 // Shows the bubble for a request that has just been dequeued, or re-show a |
152 // bubble after switching tabs away and back. | 153 // bubble after switching tabs away and back. |
153 void ShowBubble(); | 154 void ShowBubble(); |
154 | 155 |
155 // Delete the view object | 156 // Delete the view object |
156 void DeleteBubble(); | 157 void DeleteBubble(); |
157 | 158 |
158 // Delete the view object, finalize requests, asynchronously show a queued | 159 // Delete the view object, finalize requests, asynchronously show a queued |
159 // request if present. | 160 // request if present. |
160 void FinalizeBubble(); | 161 void FinalizeBubble(PermissionAction permission_action); |
161 | 162 |
162 // Cancel all pending or active requests and destroy the PermissionPrompt if | 163 // Cancel all pending or active requests and destroy the PermissionPrompt if |
163 // one exists. This is called if the WebContents is destroyed or navigates its | 164 // one exists. This is called if the WebContents is destroyed or navigates its |
164 // main frame. | 165 // main frame. |
165 void CleanUpRequests(); | 166 void CleanUpRequests(); |
166 | 167 |
167 // Searches |requests_|, |queued_requests_| and |queued_frame_requests_| - but | 168 // Searches |requests_|, |queued_requests_| and |queued_frame_requests_| - but |
168 // *not* |duplicate_requests_| - for a request matching |request|, and returns | 169 // *not* |duplicate_requests_| - for a request matching |request|, and returns |
169 // the matching request, or |nullptr| if no match. Note that the matching | 170 // the matching request, or |nullptr| if no match. Note that the matching |
170 // request may or may not be the same object as |request|. | 171 // request may or may not be the same object as |request|. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // Whether the response to each request should be persisted. | 205 // Whether the response to each request should be persisted. |
205 bool persist_; | 206 bool persist_; |
206 | 207 |
207 base::ObserverList<Observer> observer_list_; | 208 base::ObserverList<Observer> observer_list_; |
208 AutoResponseType auto_response_for_test_; | 209 AutoResponseType auto_response_for_test_; |
209 | 210 |
210 base::WeakPtrFactory<PermissionRequestManager> weak_factory_; | 211 base::WeakPtrFactory<PermissionRequestManager> weak_factory_; |
211 }; | 212 }; |
212 | 213 |
213 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ | 214 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ |
OLD | NEW |