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

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

Issue 447493002: [Android] Force showing insertion handle when paste popup activated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for emptiness 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
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 e77d7f3e9277b0cd2e95097576756520171f6492..dea480645492e8a98b2ee8cdca1ef0fcaeabb194 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1378,6 +1378,26 @@ void RenderWidgetHostViewAndroid::HideTextHandles() {
selection_controller_->HideAndDisallowShowingAutomatically();
}
+void RenderWidgetHostViewAndroid::OnShowingPastePopup(
+ const gfx::PointF& point) {
+ if (!selection_controller_)
+ return;
+
+ // As the paste popup may be triggered *before* the bounds and editability
+ // of the region have been updated, explicitly set the properties now.
+ // TODO(jdduke): Remove this workaround when auxiliary paste popup
+ // notifications are no longer required, crbug.com/398170.
+ gfx::RectF rect(point, gfx::SizeF());
+ TouchHandleOrientation orientation = TOUCH_HANDLE_CENTER;
+ const bool visible = true;
+ HideTextHandles();
+ ShowSelectionHandlesAutomatically();
+ selection_controller_->OnSelectionEditable(true);
+ selection_controller_->OnSelectionEmpty(true);
+ selection_controller_->OnSelectionBoundsChanged(
+ rect, orientation, visible, rect, orientation, visible);
+}
+
SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const {
return cached_background_color_;
}

Powered by Google App Engine
This is Rietveld 408576698