| 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 ce3e7c0cf2e1f0ef3d5daa5160a94ddc00085540..0e8a6ca285746283ef51cff0a0ec37a6d8ad3a2b 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| @@ -78,6 +78,8 @@
|
| #include "ui/gfx/screen.h"
|
| #include "ui/gfx/size_conversions.h"
|
| #include "ui/gfx/skia_util.h"
|
| +#include "ui/keyboard/keyboard_controller.h"
|
| +#include "ui/keyboard/keyboard_util.h"
|
| #include "ui/wm/public/activation_client.h"
|
| #include "ui/wm/public/scoped_tooltip_disabler.h"
|
| #include "ui/wm/public/tooltip_client.h"
|
| @@ -1451,6 +1453,18 @@ void RenderWidgetHostViewAura::OnSwapCompositorFrame(
|
| }
|
| }
|
|
|
| +float RenderWidgetHostViewAura::GetOverdrawBottomHeight() const {
|
| + float overdraw = 0.f;
|
| +#if defined(OS_CHROMEOS)
|
| + gfx::Rect window_bounds = window_->GetBoundsInScreen();
|
| + gfx::Rect intersect = gfx::IntersectRects(window_bounds,
|
| + virtual_keyboard_bounds_);
|
| + if (intersect.height() > 0 && intersect.height() < window_bounds.height())
|
| + overdraw = intersect.height();
|
| +#endif
|
| + return overdraw;
|
| +}
|
| +
|
| #if defined(OS_WIN)
|
| void RenderWidgetHostViewAura::SetParentNativeViewAccessible(
|
| gfx::NativeViewAccessible accessible_parent) {
|
| @@ -3098,6 +3112,11 @@ void RenderWidgetHostViewAura::AddedToRootWindow() {
|
| input_method->SetFocusedTextInputClient(this);
|
| }
|
|
|
| + keyboard::KeyboardController* keyboard_controller =
|
| + keyboard::KeyboardController::GetInstance();
|
| + if (keyboard_controller)
|
| + keyboard_controller->AddObserver(this);
|
| +
|
| #if defined(OS_WIN)
|
| // The parent may have changed here. Ensure that the legacy window is
|
| // reparented accordingly.
|
| @@ -3122,6 +3141,11 @@ void RenderWidgetHostViewAura::RemovingFromRootWindow() {
|
|
|
| DetachFromInputMethod();
|
|
|
| + keyboard::KeyboardController* keyboard_controller =
|
| + keyboard::KeyboardController::GetInstance();
|
| + if (keyboard_controller)
|
| + keyboard_controller->RemoveObserver(this);
|
| +
|
| window_->GetHost()->RemoveObserver(this);
|
| RunOnCommitCallbacks();
|
| resize_lock_.reset();
|
| @@ -3212,6 +3236,22 @@ void RenderWidgetHostViewAura::OnLayerRecreated(ui::Layer* old_layer,
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| +// RenderWidgetHostViewAura, keyboard::KeyboardControllerObserver
|
| +// implementation:
|
| +
|
| +void RenderWidgetHostViewAura::OnKeyboardBoundsChanging(
|
| + const gfx::Rect& new_bounds) {
|
| +#if defined(OS_CHROMEOS)
|
| + if (!keyboard::IsKeyboardOverscrollEnabled())
|
| + return;
|
| + if (virtual_keyboard_bounds_ != new_bounds) {
|
| + virtual_keyboard_bounds_ = new_bounds;
|
| + host_->WasResized();
|
| + }
|
| +#endif
|
| +}
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| // RenderWidgetHostView, public:
|
|
|
| // static
|
|
|