Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: components/html_viewer/html_frame.h

Issue 1371773003: mandoline: Add find in page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Further patch cleanup; use a WeakPtrFactory in FindController. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 blink::WebElement GetFocusedElement();
sky 2015/10/05 15:55:08 This should document it returns the focused elemen
254
247 // Returns the Frame associated with the specified WebFrame. 255 // Returns the Frame associated with the specified WebFrame.
248 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame); 256 HTMLFrame* FindFrameWithWebFrame(blink::WebFrame* web_frame);
249 257
250 // The various frameDetached() implementations call into this. 258 // The various frameDetached() implementations call into this.
251 void FrameDetachedImpl(blink::WebFrame* web_frame); 259 void FrameDetachedImpl(blink::WebFrame* web_frame);
252 260
253 // mus::ViewObserver methods: 261 // mus::ViewObserver methods:
254 void OnViewBoundsChanged(mus::View* view, 262 void OnViewBoundsChanged(mus::View* view,
255 const mojo::Rect& old_bounds, 263 const mojo::Rect& old_bounds,
256 const mojo::Rect& new_bounds) override; 264 const mojo::Rect& new_bounds) override;
(...skipping 16 matching lines...) Expand all
273 const mojo::String& name, 281 const mojo::String& name,
274 mojo::Array<uint8_t> new_value) override; 282 mojo::Array<uint8_t> new_value) override;
275 void OnPostMessageEvent( 283 void OnPostMessageEvent(
276 uint32_t source_frame_id, 284 uint32_t source_frame_id,
277 uint32_t target_frame_id, 285 uint32_t target_frame_id,
278 web_view::mojom::HTMLMessageEventPtr serialized_event) override; 286 web_view::mojom::HTMLMessageEventPtr serialized_event) override;
279 void OnWillNavigate(const mojo::String& origin, 287 void OnWillNavigate(const mojo::String& origin,
280 const OnWillNavigateCallback& callback) override; 288 const OnWillNavigateCallback& callback) override;
281 void OnFrameLoadingStateChanged(uint32_t frame_id, bool loading) override; 289 void OnFrameLoadingStateChanged(uint32_t frame_id, bool loading) override;
282 void OnDispatchFrameLoadEvent(uint32_t frame_id) override; 290 void OnDispatchFrameLoadEvent(uint32_t frame_id) override;
291 void Find(int32 request_id,
292 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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698