| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 const std::vector<HTMLFrame*>& children() { return children_; } | 121 const std::vector<HTMLFrame*>& children() { return children_; } |
| 122 | 122 |
| 123 // Returns the WebFrame for this Frame. This is either a WebLocalFrame or | 123 // Returns the WebFrame for this Frame. This is either a WebLocalFrame or |
| 124 // WebRemoteFrame. | 124 // WebRemoteFrame. |
| 125 blink::WebFrame* web_frame() { return web_frame_; } | 125 blink::WebFrame* web_frame() { return web_frame_; } |
| 126 | 126 |
| 127 // Returns the WebView for this frame, or null if there isn't one. The root | 127 // Returns the WebView for this frame, or null if there isn't one. The root |
| 128 // has a WebView, the children WebFrameWidgets. | 128 // has a WebView, the children WebFrameWidgets. |
| 129 blink::WebView* web_view(); | 129 blink::WebView* web_view(); |
| 130 blink::WebView* web_view() const; |
| 130 blink::WebWidget* GetWebWidget(); | 131 blink::WebWidget* GetWebWidget(); |
| 131 | 132 |
| 132 // The mus::View this frame renders to. This is non-null for the local frame | 133 // The mus::View this frame renders to. This is non-null for the local frame |
| 133 // the frame tree was created with as well as non-null for any frames created | 134 // the frame tree was created with as well as non-null for any frames created |
| 134 // locally. | 135 // locally. |
| 135 mus::View* view() { return view_; } | 136 mus::View* view() { return view_; } |
| 136 | 137 |
| 137 HTMLFrameTreeManager* frame_tree_manager() { return frame_tree_manager_; } | 138 HTMLFrameTreeManager* frame_tree_manager() { return frame_tree_manager_; } |
| 138 | 139 |
| 139 // Returns null if the browser side didn't request to setup an agent in this | 140 // Returns null if the browser side didn't request to setup an agent in this |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 virtual void dispatchLoad(); | 184 virtual void dispatchLoad(); |
| 184 virtual void didChangeName(blink::WebLocalFrame* frame, | 185 virtual void didChangeName(blink::WebLocalFrame* frame, |
| 185 const blink::WebString& name); | 186 const blink::WebString& name); |
| 186 virtual void didCommitProvisionalLoad( | 187 virtual void didCommitProvisionalLoad( |
| 187 blink::WebLocalFrame* frame, | 188 blink::WebLocalFrame* frame, |
| 188 const blink::WebHistoryItem& item, | 189 const blink::WebHistoryItem& item, |
| 189 blink::WebHistoryCommitType commit_type); | 190 blink::WebHistoryCommitType commit_type); |
| 190 virtual void didReceiveTitle(blink::WebLocalFrame* frame, | 191 virtual void didReceiveTitle(blink::WebLocalFrame* frame, |
| 191 const blink::WebString& title, | 192 const blink::WebString& title, |
| 192 blink::WebTextDirection direction); | 193 blink::WebTextDirection direction); |
| 194 virtual void reportFindInPageMatchCount(int identifier, |
| 195 int count, |
| 196 bool finalUpdate); |
| 197 virtual void reportFindInPageSelection(int identifier, |
| 198 int activeMatchOrdinal, |
| 199 const blink::WebRect& selection); |
| 193 | 200 |
| 194 private: | 201 private: |
| 195 friend class HTMLFrameTreeManager; | 202 friend class HTMLFrameTreeManager; |
| 196 | 203 |
| 197 // Binds this frame to the specified server. |this| serves as the | 204 // Binds this frame to the specified server. |this| serves as the |
| 198 // FrameClient for the server. | 205 // FrameClient for the server. |
| 199 void Bind(web_view::mojom::FramePtr frame, | 206 void Bind(web_view::mojom::FramePtr frame, |
| 200 mojo::InterfaceRequest<web_view::mojom::FrameClient> | 207 mojo::InterfaceRequest<web_view::mojom::FrameClient> |
| 201 frame_client_request); | 208 frame_client_request); |
| 202 | 209 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 233 mus::View* view, | 240 mus::View* view, |
| 234 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties); | 241 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties); |
| 235 | 242 |
| 236 // Invoked when changing the delegate. This informs the new delegate to take | 243 // Invoked when changing the delegate. This informs the new delegate to take |
| 237 // over. This is used when a different connection is going to take over | 244 // over. This is used when a different connection is going to take over |
| 238 // responsibility for the frame. | 245 // responsibility for the frame. |
| 239 void SwapDelegate(HTMLFrameDelegate* delegate); | 246 void SwapDelegate(HTMLFrameDelegate* delegate); |
| 240 | 247 |
| 241 GlobalState* global_state() { return frame_tree_manager_->global_state(); } | 248 GlobalState* global_state() { return frame_tree_manager_->global_state(); } |
| 242 | 249 |
| 250 blink::WebElement GetFocusedElement() const; |
| 251 |
| 243 // Returns the Frame associated with the specified WebFrame. | 252 // Returns the Frame associated with the specified WebFrame. |
| 244 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame); | 253 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame); |
| 245 | 254 |
| 246 // The various frameDetached() implementations call into this. | 255 // The various frameDetached() implementations call into this. |
| 247 void FrameDetachedImpl(blink::WebFrame* web_frame); | 256 void FrameDetachedImpl(blink::WebFrame* web_frame); |
| 248 | 257 |
| 249 // mus::ViewObserver methods: | 258 // mus::ViewObserver methods: |
| 250 void OnViewBoundsChanged(mus::View* view, | 259 void OnViewBoundsChanged(mus::View* view, |
| 251 const mojo::Rect& old_bounds, | 260 const mojo::Rect& old_bounds, |
| 252 const mojo::Rect& new_bounds) override; | 261 const mojo::Rect& new_bounds) override; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 269 const mojo::String& name, | 278 const mojo::String& name, |
| 270 mojo::Array<uint8_t> new_value) override; | 279 mojo::Array<uint8_t> new_value) override; |
| 271 void OnPostMessageEvent( | 280 void OnPostMessageEvent( |
| 272 uint32_t source_frame_id, | 281 uint32_t source_frame_id, |
| 273 uint32_t target_frame_id, | 282 uint32_t target_frame_id, |
| 274 web_view::mojom::HTMLMessageEventPtr serialized_event) override; | 283 web_view::mojom::HTMLMessageEventPtr serialized_event) override; |
| 275 void OnWillNavigate(const mojo::String& origin, | 284 void OnWillNavigate(const mojo::String& origin, |
| 276 const OnWillNavigateCallback& callback) override; | 285 const OnWillNavigateCallback& callback) override; |
| 277 void OnFrameLoadingStateChanged(uint32_t frame_id, bool loading) override; | 286 void OnFrameLoadingStateChanged(uint32_t frame_id, bool loading) override; |
| 278 void OnDispatchFrameLoadEvent(uint32_t frame_id) override; | 287 void OnDispatchFrameLoadEvent(uint32_t frame_id) override; |
| 288 void OnFind(int32 request_id, const mojo::String& search_text) override; |
| 289 void OnStopFinding() override; |
| 279 | 290 |
| 280 // blink::WebRemoteFrameClient: | 291 // blink::WebRemoteFrameClient: |
| 281 virtual void frameDetached(blink::WebRemoteFrameClient::DetachType type); | 292 virtual void frameDetached(blink::WebRemoteFrameClient::DetachType type); |
| 282 virtual void postMessageEvent(blink::WebLocalFrame* source_web_frame, | 293 virtual void postMessageEvent(blink::WebLocalFrame* source_web_frame, |
| 283 blink::WebRemoteFrame* target_web_frame, | 294 blink::WebRemoteFrame* target_web_frame, |
| 284 blink::WebSecurityOrigin target_origin, | 295 blink::WebSecurityOrigin target_origin, |
| 285 blink::WebDOMMessageEvent event); | 296 blink::WebDOMMessageEvent event); |
| 286 virtual void initializeChildFrame(const blink::WebRect& frame_rect, | 297 virtual void initializeChildFrame(const blink::WebRect& frame_rect, |
| 287 float scale_factor); | 298 float scale_factor); |
| 288 virtual void navigate(const blink::WebURLRequest& request, | 299 virtual void navigate(const blink::WebURLRequest& request, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 scoped_ptr<DevToolsAgentImpl> devtools_agent_; | 342 scoped_ptr<DevToolsAgentImpl> devtools_agent_; |
| 332 | 343 |
| 333 base::WeakPtrFactory<HTMLFrame> weak_factory_; | 344 base::WeakPtrFactory<HTMLFrame> weak_factory_; |
| 334 | 345 |
| 335 DISALLOW_COPY_AND_ASSIGN(HTMLFrame); | 346 DISALLOW_COPY_AND_ASSIGN(HTMLFrame); |
| 336 }; | 347 }; |
| 337 | 348 |
| 338 } // namespace html_viewer | 349 } // namespace html_viewer |
| 339 | 350 |
| 340 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ | 351 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ |
| OLD | NEW |