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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2571583008: Support tracking focused element for OOPIFs. (Closed)
Patch Set: Fixed some compile errors 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 return; 181 return;
182 182
183 host_->GetView()->SetInsets(gfx::Insets(0, 0, viewport_bottom, 0)); 183 host_->GetView()->SetInsets(gfx::Insets(0, 0, viewport_bottom, 0));
184 184
185 gfx::Point origin(location_in_screen_); 185 gfx::Point origin(location_in_screen_);
186 screen_position_client->ConvertPointFromScreen(window_, &origin); 186 screen_position_client->ConvertPointFromScreen(window_, &origin);
187 187
188 // We want to scroll the node into a rectangle which originates from 188 // We want to scroll the node into a rectangle which originates from
189 // the touch point and a small offset (10) in either direction. 189 // the touch point and a small offset (10) in either direction.
190 gfx::Rect node_rect(origin.x(), origin.y(), 10, 10); 190 gfx::Rect node_rect(origin.x(), origin.y(), 10, 10);
191 host_->ScrollFocusedEditableNodeIntoRect(node_rect); 191 host_->ScrollFocusedEditableNodeIntoRect(node_rect);
EhsanK 2016/12/20 16:39:11 This is the spot which needs to get fixed. Since w
192 } 192 }
193 } 193 }
194 194
195 void OnKeyboardHidden(const gfx::Rect& keyboard_rect_pixels) override { 195 void OnKeyboardHidden(const gfx::Rect& keyboard_rect_pixels) override {
196 // Restore the viewport. 196 // Restore the viewport.
197 host_->GetView()->SetInsets(gfx::Insets()); 197 host_->GetView()->SetInsets(gfx::Insets());
198 } 198 }
199 199
200 private: 200 private:
201 RenderWidgetHostImpl* host_; 201 RenderWidgetHostImpl* host_;
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 const gfx::Point& location_dips_screen, 786 const gfx::Point& location_dips_screen,
787 bool editable) { 787 bool editable) {
788 #if defined(OS_WIN) 788 #if defined(OS_WIN)
789 RenderViewHost* rvh = RenderViewHost::From(host_); 789 RenderViewHost* rvh = RenderViewHost::From(host_);
790 if (rvh && rvh->GetDelegate()) 790 if (rvh && rvh->GetDelegate())
791 rvh->GetDelegate()->SetIsVirtualKeyboardRequested(editable); 791 rvh->GetDelegate()->SetIsVirtualKeyboardRequested(editable);
792 792
793 ui::OnScreenKeyboardDisplayManager* osk_display_manager = 793 ui::OnScreenKeyboardDisplayManager* osk_display_manager =
794 ui::OnScreenKeyboardDisplayManager::GetInstance(); 794 ui::OnScreenKeyboardDisplayManager::GetInstance();
795 DCHECK(osk_display_manager); 795 DCHECK(osk_display_manager);
796 if (editable && host_ && host_->GetView()) { 796 if (editable && host_ && host_->GetView() && host_->delegate()) {
797 RenderWidgetHostImpl* host =
798 host_->delegate()->GetFocusedRenderWidgetHost(host_);
797 keyboard_observer_.reset(new WinScreenKeyboardObserver( 799 keyboard_observer_.reset(new WinScreenKeyboardObserver(
798 host_, location_dips_screen, device_scale_factor_, window_)); 800 host, location_dips_screen, device_scale_factor_, window_));
ncarter (slow) 2016/12/16 19:17:21 I'm thinking about the case here where (host_ != h
EhsanK 2016/12/20 16:39:11 Agreed. It is probably actually incorrect.
799 virtual_keyboard_requested_ = 801 virtual_keyboard_requested_ =
800 osk_display_manager->DisplayVirtualKeyboard(keyboard_observer_.get()); 802 osk_display_manager->DisplayVirtualKeyboard(keyboard_observer_.get());
801 } else { 803 } else {
802 virtual_keyboard_requested_ = false; 804 virtual_keyboard_requested_ = false;
803 osk_display_manager->DismissVirtualKeyboard(); 805 osk_display_manager->DismissVirtualKeyboard();
804 } 806 }
805 #endif 807 #endif
806 } 808 }
807 809
808 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) { 810 void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) {
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after
2394 2396
2395 void RenderWidgetHostViewAura::SetPopupChild( 2397 void RenderWidgetHostViewAura::SetPopupChild(
2396 RenderWidgetHostViewAura* popup_child_host_view) { 2398 RenderWidgetHostViewAura* popup_child_host_view) {
2397 popup_child_host_view_ = popup_child_host_view; 2399 popup_child_host_view_ = popup_child_host_view;
2398 event_handler_->SetPopupChild( 2400 event_handler_->SetPopupChild(
2399 popup_child_host_view, 2401 popup_child_host_view,
2400 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); 2402 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr);
2401 } 2403 }
2402 2404
2403 } // namespace content 2405 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698