| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // the web contents that the PermissionRequestManager belongs to. | 77 // the web contents that the PermissionRequestManager belongs to. |
| 78 void DisplayPendingRequests(); | 78 void DisplayPendingRequests(); |
| 79 | 79 |
| 80 // Will reposition the bubble (may change parent if necessary). | 80 // Will reposition the bubble (may change parent if necessary). |
| 81 void UpdateAnchorPosition(); | 81 void UpdateAnchorPosition(); |
| 82 | 82 |
| 83 // True if a permission bubble is currently visible. | 83 // True if a permission bubble is currently visible. |
| 84 // TODO(hcarmona): Remove this as part of the bubble API work. | 84 // TODO(hcarmona): Remove this as part of the bubble API work. |
| 85 bool IsBubbleVisible(); | 85 bool IsBubbleVisible(); |
| 86 | 86 |
| 87 // Whether PermissionRequestManager is reused on Android, instead of |
| 88 // PermissionQueueController. |
| 89 static bool IsEnabled(); |
| 90 |
| 87 // Get the native window of the bubble. | 91 // Get the native window of the bubble. |
| 88 // TODO(hcarmona): Remove this as part of the bubble API work. | 92 // TODO(hcarmona): Remove this as part of the bubble API work. |
| 89 gfx::NativeWindow GetBubbleWindow(); | 93 gfx::NativeWindow GetBubbleWindow(); |
| 90 | 94 |
| 91 // For observing the status of the permission bubble manager. | 95 // For observing the status of the permission bubble manager. |
| 92 void AddObserver(Observer* observer); | 96 void AddObserver(Observer* observer); |
| 93 void RemoveObserver(Observer* observer); | 97 void RemoveObserver(Observer* observer); |
| 94 | 98 |
| 95 // Do NOT use this methods in production code. Use this methods in browser | 99 // Do NOT use this methods in production code. Use this methods in browser |
| 96 // tests that need to accept or deny permissions when requested in | 100 // tests that need to accept or deny permissions when requested in |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // Whether each of the requests in |requests_| is accepted by the user. | 197 // Whether each of the requests in |requests_| is accepted by the user. |
| 194 std::vector<bool> accept_states_; | 198 std::vector<bool> accept_states_; |
| 195 | 199 |
| 196 base::ObserverList<Observer> observer_list_; | 200 base::ObserverList<Observer> observer_list_; |
| 197 AutoResponseType auto_response_for_test_; | 201 AutoResponseType auto_response_for_test_; |
| 198 | 202 |
| 199 base::WeakPtrFactory<PermissionRequestManager> weak_factory_; | 203 base::WeakPtrFactory<PermissionRequestManager> weak_factory_; |
| 200 }; | 204 }; |
| 201 | 205 |
| 202 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ | 206 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ |
| OLD | NEW |