Index: content/browser/renderer_host/text_input_manager.h |
diff --git a/content/browser/renderer_host/text_input_manager.h b/content/browser/renderer_host/text_input_manager.h |
index 797f2ee3b7e7af91df122257ea53dacd6eae6413..985a2758d7c69024f1d3b4dc30e30dff8e25060c 100644 |
--- a/content/browser/renderer_host/text_input_manager.h |
+++ b/content/browser/renderer_host/text_input_manager.h |
@@ -105,20 +105,22 @@ class CONTENT_EXPORT TextInputManager { |
void SetSelection(const base::string16& text, |
size_t offset, |
- const gfx::Range& range); |
+ const gfx::Range& range, |
+ bool user_initiated); |
const base::string16& selected_text() const { return selected_text_; } |
size_t offset() const { return offset_; } |
const gfx::Range& range() const { return range_; } |
const base::string16& text() const { return text_; } |
+ bool user_initiated() const { return user_initiated_; } |
private: |
// The offset of the text stored in |text| relative to the start of the web |
// page. |
- size_t offset_; |
+ size_t offset_ = 0; |
// The range of the selection in the page (highlighted text). |
- gfx::Range range_; |
+ gfx::Range range_ = gfx::Range::InvalidRange(); |
// The highlighted text which is the portion of |text_| marked by |offset_| |
// and |range_|. It will be an empty string if either |text_| or |range_| |
@@ -129,6 +131,9 @@ class CONTENT_EXPORT TextInputManager { |
// Part of the text on the page which includes the highlighted text plus |
// possibly several characters before and after it. |
base::string16 text_; |
+ |
+ // True if text selection is triggered by user input. |
+ bool user_initiated_ = false; |
}; |
TextInputManager(); |
@@ -194,7 +199,8 @@ class CONTENT_EXPORT TextInputManager { |
void SelectionChanged(RenderWidgetHostViewBase* view, |
const base::string16& text, |
size_t offset, |
- const gfx::Range& range); |
+ const gfx::Range& range, |
+ bool user_initiated); |
// Registers the given |view| for tracking its TextInputState. This is called |
// by any view which has updates in its TextInputState (whether tab's RWHV or |