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 EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_FIND_HELPER_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_FIND_HELPER_H_ |
6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_FIND_HELPER_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_FIND_HELPER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 scoped_refptr<WebViewInternalFindFunction> find_function_; | 148 scoped_refptr<WebViewInternalFindFunction> find_function_; |
149 FindResults find_results_; | 149 FindResults find_results_; |
150 | 150 |
151 // A find reply has been received for this find request. | 151 // A find reply has been received for this find request. |
152 bool replied_; | 152 bool replied_; |
153 | 153 |
154 // Stores pointers to all the find next requests if this is the first | 154 // Stores pointers to all the find next requests if this is the first |
155 // request of a find session. | 155 // request of a find session. |
156 std::vector<base::WeakPtr<FindInfo> > find_next_requests_; | 156 std::vector<base::WeakPtr<FindInfo> > find_next_requests_; |
157 | 157 |
158 // Weak pointer used to access the find info of fin. | |
159 base::WeakPtrFactory<FindInfo> weak_ptr_factory_; | |
160 | |
161 friend void WebViewFindHelper::EndFindSession(int session_request_id, | 158 friend void WebViewFindHelper::EndFindSession(int session_request_id, |
162 bool canceled); | 159 bool canceled); |
163 | 160 |
| 161 // Weak pointer used to access the find info of fin. |
| 162 base::WeakPtrFactory<FindInfo> weak_ptr_factory_; |
| 163 |
164 DISALLOW_COPY_AND_ASSIGN(FindInfo); | 164 DISALLOW_COPY_AND_ASSIGN(FindInfo); |
165 }; | 165 }; |
166 | 166 |
167 // Pointer to the webview that is being helped. | 167 // Pointer to the webview that is being helped. |
168 WebViewGuest* const webview_guest_; | 168 WebViewGuest* const webview_guest_; |
169 | 169 |
170 // A counter to generate a unique request id for a find request. | 170 // A counter to generate a unique request id for a find request. |
171 // We only need the ids to be unique for a given WebViewGuest. | 171 // We only need the ids to be unique for a given WebViewGuest. |
172 int current_find_request_id_; | 172 int current_find_request_id_; |
173 | 173 |
174 // Stores aggregated find results and other info for the |findupdate| event. | 174 // Stores aggregated find results and other info for the |findupdate| event. |
175 scoped_ptr<FindUpdateEvent> find_update_event_; | 175 scoped_ptr<FindUpdateEvent> find_update_event_; |
176 | 176 |
177 // Pointer to the first request of the current find session. | 177 // Pointer to the first request of the current find session. |
178 linked_ptr<FindInfo> current_find_session_; | 178 linked_ptr<FindInfo> current_find_session_; |
179 | 179 |
180 // Stores each find request's information by request_id so that its callback | 180 // Stores each find request's information by request_id so that its callback |
181 // function can be called when its find results are available. | 181 // function can be called when its find results are available. |
182 typedef std::map<int, linked_ptr<FindInfo> > FindInfoMap; | 182 typedef std::map<int, linked_ptr<FindInfo> > FindInfoMap; |
183 FindInfoMap find_info_map_; | 183 FindInfoMap find_info_map_; |
184 | 184 |
185 DISALLOW_COPY_AND_ASSIGN(WebViewFindHelper); | 185 DISALLOW_COPY_AND_ASSIGN(WebViewFindHelper); |
186 }; | 186 }; |
187 | 187 |
188 } // namespace extensions | 188 } // namespace extensions |
189 | 189 |
190 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_FIND_HELPER_H_ | 190 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_FIND_HELPER_H_ |
OLD | NEW |