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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 | 121 |
122 const std::vector<HTMLFrame*>& children() { return children_; } | 122 const std::vector<HTMLFrame*>& children() { return children_; } |
123 | 123 |
124 // Returns the WebFrame for this Frame. This is either a WebLocalFrame or | 124 // Returns the WebFrame for this Frame. This is either a WebLocalFrame or |
125 // WebRemoteFrame. | 125 // WebRemoteFrame. |
126 blink::WebFrame* web_frame() { return web_frame_; } | 126 blink::WebFrame* web_frame() { return web_frame_; } |
127 | 127 |
128 // Returns the WebView for this frame, or null if there isn't one. The root | 128 // Returns the WebView for this frame, or null if there isn't one. The root |
129 // has a WebView, the children WebFrameWidgets. | 129 // has a WebView, the children WebFrameWidgets. |
130 blink::WebView* web_view(); | 130 blink::WebView* web_view(); |
131 blink::WebView* web_view() const; | |
sky
2015/10/02 16:03:40
Having a const function return a non-const is bad.
Elliot Glaysher
2015/10/02 21:42:33
Deleted this and made GetFocusedElement() non cons
| |
131 blink::WebWidget* GetWebWidget(); | 132 blink::WebWidget* GetWebWidget(); |
132 | 133 |
133 // The mus::View this frame renders to. This is non-null for the local frame | 134 // The mus::View this frame renders to. This is non-null for the local frame |
134 // the frame tree was created with as well as non-null for any frames created | 135 // the frame tree was created with as well as non-null for any frames created |
135 // locally. | 136 // locally. |
136 mus::View* view() { return view_; } | 137 mus::View* view() { return view_; } |
137 | 138 |
138 HTMLFrameTreeManager* frame_tree_manager() { return frame_tree_manager_; } | 139 HTMLFrameTreeManager* frame_tree_manager() { return frame_tree_manager_; } |
139 | 140 |
140 // Returns null if the browser side didn't request to setup an agent in this | 141 // Returns null if the browser side didn't request to setup an agent in this |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 virtual void dispatchLoad(); | 188 virtual void dispatchLoad(); |
188 virtual void didChangeName(blink::WebLocalFrame* frame, | 189 virtual void didChangeName(blink::WebLocalFrame* frame, |
189 const blink::WebString& name); | 190 const blink::WebString& name); |
190 virtual void didCommitProvisionalLoad( | 191 virtual void didCommitProvisionalLoad( |
191 blink::WebLocalFrame* frame, | 192 blink::WebLocalFrame* frame, |
192 const blink::WebHistoryItem& item, | 193 const blink::WebHistoryItem& item, |
193 blink::WebHistoryCommitType commit_type); | 194 blink::WebHistoryCommitType commit_type); |
194 virtual void didReceiveTitle(blink::WebLocalFrame* frame, | 195 virtual void didReceiveTitle(blink::WebLocalFrame* frame, |
195 const blink::WebString& title, | 196 const blink::WebString& title, |
196 blink::WebTextDirection direction); | 197 blink::WebTextDirection direction); |
198 virtual void reportFindInFrameMatchCount(int identifier, | |
199 int count, | |
200 bool finalUpdate); | |
201 virtual void reportFindInPageSelection(int identifier, | |
202 int activeMatchOrdinal, | |
203 const blink::WebRect& selection); | |
197 | 204 |
198 private: | 205 private: |
199 friend class HTMLFrameTreeManager; | 206 friend class HTMLFrameTreeManager; |
200 | 207 |
201 // Binds this frame to the specified server. |this| serves as the | 208 // Binds this frame to the specified server. |this| serves as the |
202 // FrameClient for the server. | 209 // FrameClient for the server. |
203 void Bind(web_view::mojom::FramePtr frame, | 210 void Bind(web_view::mojom::FramePtr frame, |
204 mojo::InterfaceRequest<web_view::mojom::FrameClient> | 211 mojo::InterfaceRequest<web_view::mojom::FrameClient> |
205 frame_client_request); | 212 frame_client_request); |
206 | 213 |
(...skipping 30 matching lines...) Expand all Loading... | |
237 mus::View* view, | 244 mus::View* view, |
238 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties); | 245 const mojo::Map<mojo::String, mojo::Array<uint8_t>>& properties); |
239 | 246 |
240 // Invoked when changing the delegate. This informs the new delegate to take | 247 // 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 | 248 // over. This is used when a different connection is going to take over |
242 // responsibility for the frame. | 249 // responsibility for the frame. |
243 void SwapDelegate(HTMLFrameDelegate* delegate); | 250 void SwapDelegate(HTMLFrameDelegate* delegate); |
244 | 251 |
245 GlobalState* global_state() { return frame_tree_manager_->global_state(); } | 252 GlobalState* global_state() { return frame_tree_manager_->global_state(); } |
246 | 253 |
254 blink::WebElement GetFocusedElement() const; | |
255 | |
247 // Returns the Frame associated with the specified WebFrame. | 256 // Returns the Frame associated with the specified WebFrame. |
248 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame); | 257 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame); |
249 | 258 |
250 // The various frameDetached() implementations call into this. | 259 // The various frameDetached() implementations call into this. |
251 void FrameDetachedImpl(blink::WebFrame* web_frame); | 260 void FrameDetachedImpl(blink::WebFrame* web_frame); |
252 | 261 |
253 // mus::ViewObserver methods: | 262 // mus::ViewObserver methods: |
254 void OnViewBoundsChanged(mus::View* view, | 263 void OnViewBoundsChanged(mus::View* view, |
255 const mojo::Rect& old_bounds, | 264 const mojo::Rect& old_bounds, |
256 const mojo::Rect& new_bounds) override; | 265 const mojo::Rect& new_bounds) override; |
(...skipping 16 matching lines...) Expand all Loading... | |
273 const mojo::String& name, | 282 const mojo::String& name, |
274 mojo::Array<uint8_t> new_value) override; | 283 mojo::Array<uint8_t> new_value) override; |
275 void OnPostMessageEvent( | 284 void OnPostMessageEvent( |
276 uint32_t source_frame_id, | 285 uint32_t source_frame_id, |
277 uint32_t target_frame_id, | 286 uint32_t target_frame_id, |
278 web_view::mojom::HTMLMessageEventPtr serialized_event) override; | 287 web_view::mojom::HTMLMessageEventPtr serialized_event) override; |
279 void OnWillNavigate(const mojo::String& origin, | 288 void OnWillNavigate(const mojo::String& origin, |
280 const OnWillNavigateCallback& callback) override; | 289 const OnWillNavigateCallback& callback) override; |
281 void OnFrameLoadingStateChanged(uint32_t frame_id, bool loading) override; | 290 void OnFrameLoadingStateChanged(uint32_t frame_id, bool loading) override; |
282 void OnDispatchFrameLoadEvent(uint32_t frame_id) override; | 291 void OnDispatchFrameLoadEvent(uint32_t frame_id) override; |
292 void Find(int32 request_id, const mojo::String& search_text, | |
293 const FindCallback& callback) override; | |
294 void StopFinding(bool clear_selection) override; | |
295 void ScopeStringMatches(int32_t request_id, | |
296 const mojo::String& search_test, | |
297 bool reset) override; | |
298 void CancelPendingScopingEffort() override; | |
283 | 299 |
284 // blink::WebRemoteFrameClient: | 300 // blink::WebRemoteFrameClient: |
285 virtual void frameDetached(blink::WebRemoteFrameClient::DetachType type); | 301 virtual void frameDetached(blink::WebRemoteFrameClient::DetachType type); |
286 virtual void postMessageEvent(blink::WebLocalFrame* source_web_frame, | 302 virtual void postMessageEvent(blink::WebLocalFrame* source_web_frame, |
287 blink::WebRemoteFrame* target_web_frame, | 303 blink::WebRemoteFrame* target_web_frame, |
288 blink::WebSecurityOrigin target_origin, | 304 blink::WebSecurityOrigin target_origin, |
289 blink::WebDOMMessageEvent event); | 305 blink::WebDOMMessageEvent event); |
290 virtual void initializeChildFrame(const blink::WebRect& frame_rect, | 306 virtual void initializeChildFrame(const blink::WebRect& frame_rect, |
291 float scale_factor); | 307 float scale_factor); |
292 virtual void navigate(const blink::WebURLRequest& request, | 308 virtual void navigate(const blink::WebURLRequest& request, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
340 bool pending_navigation_; | 356 bool pending_navigation_; |
341 | 357 |
342 base::WeakPtrFactory<HTMLFrame> weak_factory_; | 358 base::WeakPtrFactory<HTMLFrame> weak_factory_; |
343 | 359 |
344 DISALLOW_COPY_AND_ASSIGN(HTMLFrame); | 360 DISALLOW_COPY_AND_ASSIGN(HTMLFrame); |
345 }; | 361 }; |
346 | 362 |
347 } // namespace html_viewer | 363 } // namespace html_viewer |
348 | 364 |
349 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ | 365 #endif // COMPONENTS_HTML_VIEWER_HTML_FRAME_H_ |
OLD | NEW |