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_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ |
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ | 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ |
7 | 7 |
8 #include <unordered_map> | 8 #include <unordered_map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 void RequestFinishedIncludingDuplicates(PermissionBubbleRequest* request); | 160 void RequestFinishedIncludingDuplicates(PermissionBubbleRequest* request); |
161 | 161 |
162 void NotifyBubbleAdded(); | 162 void NotifyBubbleAdded(); |
163 | 163 |
164 void DoAutoResponseForTesting(); | 164 void DoAutoResponseForTesting(); |
165 | 165 |
166 // Factory to be used to create views when needed. | 166 // Factory to be used to create views when needed. |
167 PermissionBubbleView::Factory view_factory_; | 167 PermissionBubbleView::Factory view_factory_; |
168 | 168 |
169 // The UI surface to be used to display the permissions requests. | 169 // The UI surface to be used to display the permissions requests. |
170 scoped_ptr<PermissionBubbleView> view_; | 170 std::unique_ptr<PermissionBubbleView> view_; |
171 | 171 |
172 std::vector<PermissionBubbleRequest*> requests_; | 172 std::vector<PermissionBubbleRequest*> requests_; |
173 std::vector<PermissionBubbleRequest*> queued_requests_; | 173 std::vector<PermissionBubbleRequest*> queued_requests_; |
174 std::vector<PermissionBubbleRequest*> queued_frame_requests_; | 174 std::vector<PermissionBubbleRequest*> queued_frame_requests_; |
175 // Maps from the first request of a kind to subsequent requests that were | 175 // Maps from the first request of a kind to subsequent requests that were |
176 // duped against it. | 176 // duped against it. |
177 std::unordered_multimap<PermissionBubbleRequest*, PermissionBubbleRequest*> | 177 std::unordered_multimap<PermissionBubbleRequest*, PermissionBubbleRequest*> |
178 duplicate_requests_; | 178 duplicate_requests_; |
179 | 179 |
180 // URL of the main frame in the WebContents to which this manager is attached. | 180 // URL of the main frame in the WebContents to which this manager is attached. |
181 // TODO(gbillock): if there are iframes in the page, we need to deal with it. | 181 // TODO(gbillock): if there are iframes in the page, we need to deal with it. |
182 GURL request_url_; | 182 GURL request_url_; |
183 bool main_frame_has_fully_loaded_; | 183 bool main_frame_has_fully_loaded_; |
184 | 184 |
185 // Whether each of the requests in |requests_| is accepted by the user. | 185 // Whether each of the requests in |requests_| is accepted by the user. |
186 std::vector<bool> accept_states_; | 186 std::vector<bool> accept_states_; |
187 | 187 |
188 base::ObserverList<Observer> observer_list_; | 188 base::ObserverList<Observer> observer_list_; |
189 AutoResponseType auto_response_for_test_; | 189 AutoResponseType auto_response_for_test_; |
190 | 190 |
191 base::WeakPtrFactory<PermissionBubbleManager> weak_factory_; | 191 base::WeakPtrFactory<PermissionBubbleManager> weak_factory_; |
192 }; | 192 }; |
193 | 193 |
194 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ | 194 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ |
OLD | NEW |