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

Side by Side Diff: content/renderer/render_frame_impl.h

Issue 2903833002: Reland: Update TextSelection for non-user initiated events
Patch Set: Add test for JS cursor movement Created 3 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 RenderWidget* render_widget_to_show, 317 RenderWidget* render_widget_to_show,
318 blink::WebNavigationPolicy policy, 318 blink::WebNavigationPolicy policy,
319 const gfx::Rect& initial_rect); 319 const gfx::Rect& initial_rect);
320 320
321 // Called when this frame's widget is focused. 321 // Called when this frame's widget is focused.
322 void RenderWidgetSetFocus(bool enable); 322 void RenderWidgetSetFocus(bool enable);
323 323
324 // Called when the widget receives a mouse event. 324 // Called when the widget receives a mouse event.
325 void RenderWidgetWillHandleMouseEvent(); 325 void RenderWidgetWillHandleMouseEvent();
326 326
327 // Notifies the browser of text selection changes made.
328 void SetSelectedText(const base::string16& selection_text,
329 size_t offset,
330 const gfx::Range& range,
331 bool user_initiated);
332
327 #if BUILDFLAG(ENABLE_PLUGINS) 333 #if BUILDFLAG(ENABLE_PLUGINS)
328 // Get/set the plugin which will be used to handle document find requests. 334 // Get/set the plugin which will be used to handle document find requests.
329 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) { 335 void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) {
330 plugin_find_handler_ = plugin; 336 plugin_find_handler_ = plugin;
331 } 337 }
332 PepperPluginInstanceImpl* plugin_find_handler() { 338 PepperPluginInstanceImpl* plugin_find_handler() {
333 return plugin_find_handler_; 339 return plugin_find_handler_;
334 } 340 }
335 341
336 // Notification that a PPAPI plugin has been created. 342 // Notification that a PPAPI plugin has been created.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 const url::Origin& content_origin, 448 const url::Origin& content_origin,
443 const gfx::Size& unobscured_size, 449 const gfx::Size& unobscured_size,
444 RecordPeripheralDecision record_decision) const override; 450 RecordPeripheralDecision record_decision) const override;
445 void WhitelistContentOrigin(const url::Origin& content_origin) override; 451 void WhitelistContentOrigin(const url::Origin& content_origin) override;
446 void PluginDidStartLoading() override; 452 void PluginDidStartLoading() override;
447 void PluginDidStopLoading() override; 453 void PluginDidStopLoading() override;
448 #endif 454 #endif
449 bool IsFTPDirectoryListing() override; 455 bool IsFTPDirectoryListing() override;
450 void AttachGuest(int element_instance_id) override; 456 void AttachGuest(int element_instance_id) override;
451 void DetachGuest(int element_instance_id) override; 457 void DetachGuest(int element_instance_id) override;
452 void SetSelectedText(const base::string16& selection_text,
453 size_t offset,
454 const gfx::Range& range) override;
455 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, 458 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate,
456 v8::Local<v8::Context> context) override; 459 v8::Local<v8::Context> context) override;
457 void AddMessageToConsole(ConsoleMessageLevel level, 460 void AddMessageToConsole(ConsoleMessageLevel level,
458 const std::string& message) override; 461 const std::string& message) override;
459 void DetachDevToolsForTest() override; 462 void DetachDevToolsForTest() override;
460 PreviewsState GetPreviewsState() const override; 463 PreviewsState GetPreviewsState() const override;
461 bool IsPasting() const override; 464 bool IsPasting() const override;
462 blink::WebPageVisibilityState GetVisibilityState() const override; 465 blink::WebPageVisibilityState GetVisibilityState() const override;
463 bool IsBrowserSideNavigationPending() override; 466 bool IsBrowserSideNavigationPending() override;
464 base::SingleThreadTaskRunner* GetTimerTaskRunner() override; 467 base::SingleThreadTaskRunner* GetTimerTaskRunner() override;
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 const RendererPreferences& GetRendererPreferences() const; 760 const RendererPreferences& GetRendererPreferences() const;
758 761
759 #if defined(OS_MACOSX) 762 #if defined(OS_MACOSX)
760 void OnCopyToFindPboard(); 763 void OnCopyToFindPboard();
761 #endif 764 #endif
762 765
763 // Dispatches the current state of selection on the webpage to the browser if 766 // Dispatches the current state of selection on the webpage to the browser if
764 // it has changed. 767 // it has changed.
765 // TODO(varunjain): delete this method once we figure out how to keep 768 // TODO(varunjain): delete this method once we figure out how to keep
766 // selection handles in sync with the webpage. 769 // selection handles in sync with the webpage.
767 void SyncSelectionIfRequired(); 770 void SyncSelectionIfRequired(bool user_initiated);
768 771
769 protected: 772 protected:
770 explicit RenderFrameImpl(const CreateParams& params); 773 explicit RenderFrameImpl(const CreateParams& params);
771 774
772 private: 775 private:
773 friend class RenderFrameImplTest; 776 friend class RenderFrameImplTest;
774 friend class RenderFrameObserver; 777 friend class RenderFrameObserver;
775 friend class RenderAccessibilityImplTest; 778 friend class RenderAccessibilityImplTest;
776 friend class TestRenderFrame; 779 friend class TestRenderFrame;
777 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem); 780 FRIEND_TEST_ALL_PREFIXES(ExternalPopupMenuDisplayNoneTest, SelectItem);
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_; 1423 std::vector<media::RoutingTokenCallback> pending_routing_token_callbacks_;
1421 1424
1422 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; 1425 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
1423 1426
1424 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); 1427 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
1425 }; 1428 };
1426 1429
1427 } // namespace content 1430 } // namespace content
1428 1431
1429 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 1432 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698