OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ |
6 #define COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ | 6 #define COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 virtual void dispatchLoad(); | 187 virtual void dispatchLoad(); |
188 virtual void didChangeName(blink::WebLocalFrame* frame, | 188 virtual void didChangeName(blink::WebLocalFrame* frame, |
189 const blink::WebString& name); | 189 const blink::WebString& name); |
190 virtual void didCommitProvisionalLoad( | 190 virtual void didCommitProvisionalLoad( |
191 blink::WebLocalFrame* frame, | 191 blink::WebLocalFrame* frame, |
192 const blink::WebHistoryItem& item, | 192 const blink::WebHistoryItem& item, |
193 blink::WebHistoryCommitType commit_type); | 193 blink::WebHistoryCommitType commit_type); |
194 virtual void didReceiveTitle(blink::WebLocalFrame* frame, | 194 virtual void didReceiveTitle(blink::WebLocalFrame* frame, |
195 const blink::WebString& title, | 195 const blink::WebString& title, |
196 blink::WebTextDirection direction); | 196 blink::WebTextDirection direction); |
| 197 virtual void reportFindInFrameMatchCount(int identifier, |
| 198 int count, |
| 199 bool finalUpdate); |
| 200 virtual void reportFindInPageSelection(int identifier, |
| 201 int activeMatchOrdinal, |
| 202 const blink::WebRect& selection); |
197 | 203 |
198 private: | 204 private: |
199 friend class HTMLFrameTreeManager; | 205 friend class HTMLFrameTreeManager; |
200 | 206 |
201 // Binds this frame to the specified server. |this| serves as the | 207 // Binds this frame to the specified server. |this| serves as the |
202 // FrameClient for the server. | 208 // FrameClient for the server. |
203 void Bind(web_view::mojom::FramePtr frame, | 209 void Bind(web_view::mojom::FramePtr frame, |
204 mojo::InterfaceRequest<web_view::mojom::FrameClient> | 210 mojo::InterfaceRequest<web_view::mojom::FrameClient> |
205 frame_client_request); | 211 frame_client_request); |
206 | 212 |
(...skipping 30 matching lines...) Expand all Loading... |
237 mus::View* view, | 243 mus::View* view, |
238 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties); | 244 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties); |
239 | 245 |
240 // Invoked when changing the delegate. This informs the new delegate to take | 246 // Invoked when changing the delegate. This informs the new delegate to take |
241 // over. This is used when a different connection is going to take over | 247 // over. This is used when a different connection is going to take over |
242 // responsibility for the frame. | 248 // responsibility for the frame. |
243 void SwapDelegate(HTMLFrameDelegate* delegate); | 249 void SwapDelegate(HTMLFrameDelegate* delegate); |
244 | 250 |
245 GlobalState* global_state() { return frame_tree_manager_->global_state(); } | 251 GlobalState* global_state() { return frame_tree_manager_->global_state(); } |
246 | 252 |
| 253 // Returns the focused element if the focused element is in this |
| 254 // frame. Returns an empty one otherwise. |
| 255 blink::WebElement GetFocusedElement(); |
| 256 |
247 // Returns the Frame associated with the specified WebFrame. | 257 // Returns the Frame associated with the specified WebFrame. |
248 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame); | 258 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame); |
249 | 259 |
250 // The various frameDetached() implementations call into this. | 260 // The various frameDetached() implementations call into this. |
251 void FrameDetachedImpl(blink::WebFrame* web_frame); | 261 void FrameDetachedImpl(blink::WebFrame* web_frame); |
252 | 262 |
253 // mus::ViewObserver methods: | 263 // mus::ViewObserver methods: |
254 void OnViewBoundsChanged(mus::View* view, | 264 void OnViewBoundsChanged(mus::View* view, |
255 const mojo::Rect& old_bounds, | 265 const mojo::Rect& old_bounds, |
256 const mojo::Rect& new_bounds) override; | 266 const mojo::Rect& new_bounds) override; |
(...skipping 16 matching lines...) Expand all Loading... |
273 const mojo::String& name, | 283 const mojo::String& name, |
274 mojo::Array<uint8_t> new_value) override; | 284 mojo::Array<uint8_t> new_value) override; |
275 void OnPostMessageEvent( | 285 void OnPostMessageEvent( |
276 uint32_t source_frame_id, | 286 uint32_t source_frame_id, |
277 uint32_t target_frame_id, | 287 uint32_t target_frame_id, |
278 web_view::mojom::HTMLMessageEventPtr serialized_event) override; | 288 web_view::mojom::HTMLMessageEventPtr serialized_event) override; |
279 void OnWillNavigate(const mojo::String& origin, | 289 void OnWillNavigate(const mojo::String& origin, |
280 const OnWillNavigateCallback& callback) override; | 290 const OnWillNavigateCallback& callback) override; |
281 void OnFrameLoadingStateChanged(uint32_t frame_id, bool loading) override; | 291 void OnFrameLoadingStateChanged(uint32_t frame_id, bool loading) override; |
282 void OnDispatchFrameLoadEvent(uint32_t frame_id) override; | 292 void OnDispatchFrameLoadEvent(uint32_t frame_id) override; |
| 293 void Find(int32 request_id, |
| 294 const mojo::String& search_text, |
| 295 const FindCallback& callback) override; |
| 296 void StopFinding(bool clear_selection) override; |
| 297 void HighlightFindResults(int32_t request_id, |
| 298 const mojo::String& search_test, |
| 299 bool reset) override; |
| 300 void StopHighlightingFindResults() override; |
283 | 301 |
284 // blink::WebRemoteFrameClient: | 302 // blink::WebRemoteFrameClient: |
285 virtual void frameDetached(blink::WebRemoteFrameClient::DetachType type); | 303 virtual void frameDetached(blink::WebRemoteFrameClient::DetachType type); |
286 virtual void postMessageEvent(blink::WebLocalFrame* source_web_frame, | 304 virtual void postMessageEvent(blink::WebLocalFrame* source_web_frame, |
287 blink::WebRemoteFrame* target_web_frame, | 305 blink::WebRemoteFrame* target_web_frame, |
288 blink::WebSecurityOrigin target_origin, | 306 blink::WebSecurityOrigin target_origin, |
289 blink::WebDOMMessageEvent event); | 307 blink::WebDOMMessageEvent event); |
290 virtual void initializeChildFrame(const blink::WebRect& frame_rect, | 308 virtual void initializeChildFrame(const blink::WebRect& frame_rect, |
291 float scale_factor); | 309 float scale_factor); |
292 virtual void navigate(const blink::WebURLRequest& request, | 310 virtual void navigate(const blink::WebURLRequest& request, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 bool pending_navigation_; | 358 bool pending_navigation_; |
341 | 359 |
342 base::WeakPtrFactory<HTMLFrame> weak_factory_; | 360 base::WeakPtrFactory<HTMLFrame> weak_factory_; |
343 | 361 |
344 DISALLOW_COPY_AND_ASSIGN(HTMLFrame); | 362 DISALLOW_COPY_AND_ASSIGN(HTMLFrame); |
345 }; | 363 }; |
346 | 364 |
347 } // namespace html_viewer | 365 } // namespace html_viewer |
348 | 366 |
349 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ | 367 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ |
OLD | NEW |