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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 void DidNavigateMainFrame( | 118 void DidNavigateMainFrame( |
119 const content::LoadCommittedDetails& details, | 119 const content::LoadCommittedDetails& details, |
120 const content::FrameNavigateParams& params) override; | 120 const content::FrameNavigateParams& params) override; |
121 void DocumentOnLoadCompletedInMainFrame() override; | 121 void DocumentOnLoadCompletedInMainFrame() override; |
122 void DocumentLoadedInFrame( | 122 void DocumentLoadedInFrame( |
123 content::RenderFrameHost* render_frame_host) override; | 123 content::RenderFrameHost* render_frame_host) override; |
124 void WebContentsDestroyed() override; | 124 void WebContentsDestroyed() override; |
125 | 125 |
126 // PermissionPrompt::Delegate: | 126 // PermissionPrompt::Delegate: |
127 void ToggleAccept(int request_index, bool new_value) override; | 127 void ToggleAccept(int request_index, bool new_value) override; |
| 128 void TogglePersist(bool new_value) override; |
128 void Accept() override; | 129 void Accept() override; |
129 void Deny() override; | 130 void Deny() override; |
130 void Closing() override; | 131 void Closing() override; |
131 | 132 |
132 // Posts a task which will allow the bubble to become visible if it is needed. | 133 // Posts a task which will allow the bubble to become visible if it is needed. |
133 void ScheduleShowBubble(); | 134 void ScheduleShowBubble(); |
134 | 135 |
135 // Shows the bubble if it is not already visible and there are pending | 136 // Shows the bubble if it is not already visible and there are pending |
136 // requests. | 137 // requests. |
137 void TriggerShowBubble(); | 138 void TriggerShowBubble(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // Maps from the first request of a kind to subsequent requests that were | 180 // Maps from the first request of a kind to subsequent requests that were |
180 // duped against it. | 181 // duped against it. |
181 std::unordered_multimap<PermissionRequest*, PermissionRequest*> | 182 std::unordered_multimap<PermissionRequest*, PermissionRequest*> |
182 duplicate_requests_; | 183 duplicate_requests_; |
183 | 184 |
184 // URL of the main frame in the WebContents to which this manager is attached. | 185 // URL of the main frame in the WebContents to which this manager is attached. |
185 // TODO(gbillock): if there are iframes in the page, we need to deal with it. | 186 // TODO(gbillock): if there are iframes in the page, we need to deal with it. |
186 GURL request_url_; | 187 GURL request_url_; |
187 bool main_frame_has_fully_loaded_; | 188 bool main_frame_has_fully_loaded_; |
188 | 189 |
| 190 // Whether the response to each request should be persisted. |
| 191 bool persist_; |
| 192 |
189 // Whether each of the requests in |requests_| is accepted by the user. | 193 // Whether each of the requests in |requests_| is accepted by the user. |
190 std::vector<bool> accept_states_; | 194 std::vector<bool> accept_states_; |
191 | 195 |
192 base::ObserverList<Observer> observer_list_; | 196 base::ObserverList<Observer> observer_list_; |
193 AutoResponseType auto_response_for_test_; | 197 AutoResponseType auto_response_for_test_; |
194 | 198 |
195 base::WeakPtrFactory<PermissionRequestManager> weak_factory_; | 199 base::WeakPtrFactory<PermissionRequestManager> weak_factory_; |
196 }; | 200 }; |
197 | 201 |
198 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ | 202 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ |
OLD | NEW |