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

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

Issue 712723002: suppress link disambiguation popup when virtual keyboard requested (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix linux build Created 6 years, 1 month 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_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 074a309e045a43ef514afa1c672bd7bb5a927292..37f3648fcac218e3ba43790eb914a7480c49bfd7 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1227,6 +1227,14 @@ gfx::GLSurfaceHandle RenderWidgetHostViewAura::GetCompositingSurface() {
void RenderWidgetHostViewAura::ShowDisambiguationPopup(
const gfx::Rect& rect_pixels,
const SkBitmap& zoomed_bitmap) {
+ RenderViewHostDelegate* delegate = NULL;
+ if (host_->IsRenderView())
+ delegate = RenderViewHost::From(host_)->GetDelegate();
+ // Suppress the link disambiguation popup if the virtual keyboard is currently
+ // requested, as it doesn't interact well with the keyboard.
+ if (delegate && delegate->IsVirtualKeyboardRequested())
+ return;
+
// |target_rect| is provided in pixels, not DIPs. So we convert it to DIPs
// by scaling it by the inverse of the device scale factor.
gfx::RectF screen_target_rect_f(rect_pixels);
@@ -1258,13 +1266,16 @@ void RenderWidgetHostViewAura::DisambiguationPopupRendered(
return;
// Use RenderViewHostDelegate to get to the WebContentsViewAura, which will
- // actually show the delegate.
+ // actually show the disambiguation popup.
RenderViewHostDelegate* delegate = NULL;
if (host_->IsRenderView())
delegate = RenderViewHost::From(host_)->GetDelegate();
RenderViewHostDelegateView* delegate_view = NULL;
- if (delegate)
+ if (delegate) {
delegate_view = delegate->GetDelegateView();
+ if (delegate->IsVirtualKeyboardRequested())
+ return;
+ }
if (delegate_view) {
delegate_view->ShowDisambiguationPopup(
disambiguation_target_rect_,
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698