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

Unified Diff: content/renderer/render_frame_impl.h

Issue 2903833002: Reland: Update TextSelection for non-user initiated events
Patch Set: Suppress superfluous non-user initiated text selection events Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_impl.h
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index adee335c680352b03096d26213adf4a1b256c1f5..a9004957076ddbd99e4adc8c8811b74bf5a644f4 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -325,6 +325,12 @@ class CONTENT_EXPORT RenderFrameImpl
// Called when the widget receives a mouse event.
void RenderWidgetWillHandleMouseEvent();
+ // Notifies the browser of text selection changes made.
+ void SetSelectedText(const base::string16& selection_text,
+ size_t offset,
+ const gfx::Range& range,
+ bool user_initiated);
+
#if BUILDFLAG(ENABLE_PLUGINS)
// Get/set the plugin which will be used to handle document find requests.
void set_plugin_find_handler(PepperPluginInstanceImpl* plugin) {
@@ -450,9 +456,6 @@ class CONTENT_EXPORT RenderFrameImpl
bool IsFTPDirectoryListing() override;
void AttachGuest(int element_instance_id) override;
void DetachGuest(int element_instance_id) override;
- void SetSelectedText(const base::string16& selection_text,
- size_t offset,
- const gfx::Range& range) override;
void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate,
v8::Local<v8::Context> context) override;
void AddMessageToConsole(ConsoleMessageLevel level,
@@ -763,7 +766,7 @@ class CONTENT_EXPORT RenderFrameImpl
// it has changed.
// TODO(varunjain): delete this method once we figure out how to keep
// selection handles in sync with the webpage.
- void SyncSelectionIfRequired();
+ void SyncSelectionIfRequired(bool user_initiated);
protected:
explicit RenderFrameImpl(const CreateParams& params);

Powered by Google App Engine
This is Rietveld 408576698