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

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

Issue 2571583008: Support tracking focused element for OOPIFs. (Closed)
Patch Set: Addressing comment + Added bug number to TODO Created 4 years 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 e60508ab3d021c25232001e92441bbee5457a4c6..46f67d2112c160f546a907cb463f7159c339173d 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -185,7 +185,13 @@ class WinScreenKeyboardObserver : public ui::OnScreenKeyboardObserver {
// We want to scroll the node into a rectangle which originates from
// the touch point and a small offset (10) in either direction.
gfx::Rect node_rect(origin.x(), origin.y(), 10, 10);
- host_->ScrollFocusedEditableNodeIntoRect(node_rect);
+ RenderWidgetHostImpl* host = host_;
+ if (host->delegate()) {
+ host = host->delegate()->GetFocusedRenderWidgetHost(host);
+ }
+ // TODO(ekaramad): This will not scroll the <iframe> up. Also not
+ // implemented for OOPIFs (https://crbug.com/676037).
+ host->ScrollFocusedEditableNodeIntoRect(node_rect);
}
}
@@ -780,7 +786,7 @@ void RenderWidgetHostViewAura::FocusedNodeTouched(
ui::OnScreenKeyboardDisplayManager* osk_display_manager =
ui::OnScreenKeyboardDisplayManager::GetInstance();
DCHECK(osk_display_manager);
- if (editable && host_ && host_->GetView()) {
+ if (editable && host_ && host_->GetView() && host_->delegate()) {
keyboard_observer_.reset(new WinScreenKeyboardObserver(
host_, location_dips_screen, device_scale_factor_, window_));
virtual_keyboard_requested_ =

Powered by Google App Engine
This is Rietveld 408576698