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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 425693003: Single character is coming in search box after searching empty selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased and modified patch Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 613fca905efe1e60000847735d57812d776bd0a6..331cf08f5717df35bdaa70c98379109c7b574435 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -718,8 +718,14 @@ void RenderWidgetHostViewAndroid::SelectionChanged(const base::string16& text,
if (selection_controller_)
selection_controller_->OnSelectionEmpty(text.empty());
- if (text.empty() || range.is_empty() || !content_view_core_)
+ if (!content_view_core_)
+ return;
+ if (range.is_empty()) {
+ content_view_core_->OnSelectionChanged("");
return;
+ }
+
+ DCHECK(!text.empty());
size_t pos = range.GetMin() - offset;
size_t n = range.length();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698