| 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 daf80cbdeceb6015c871c26b37ddaedf1161827e..ae56a02ca007134dcb52dabb83b1aa7e93b0a7a4 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| @@ -52,6 +52,7 @@
|
| #include "ui/aura/client/cursor_client_observer.h"
|
| #include "ui/aura/client/focus_client.h"
|
| #include "ui/aura/client/screen_position_client.h"
|
| +#include "ui/aura/client/virtual_keyboard_client.h"
|
| #include "ui/aura/client/window_tree_client.h"
|
| #include "ui/aura/env.h"
|
| #include "ui/aura/window.h"
|
| @@ -1715,6 +1716,18 @@ void RenderWidgetHostViewAura::OnSwapCompositorFrame(
|
| ack_callback);
|
| }
|
|
|
| +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) {
|
| @@ -3105,6 +3118,24 @@ void RenderWidgetHostViewAura::OnCursorVisibilityChanged(bool is_visible) {
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| +// RenderWidgetHostViewAura, aura::client::VirtualKeyboardObserver
|
| +// implementation:
|
| +
|
| +void RenderWidgetHostViewAura::OnKeyboardBoundsChanging(
|
| + const gfx::Rect& new_bounds) {
|
| +#if defined(OS_CHROMEOS)
|
| + aura::client::VirtualKeyboardClient *keyboard_client =
|
| + aura::client::GetVirtualKeyboardClient(window_->GetRootWindow());
|
| + if (!keyboard_client || !keyboard_client->IsOverscrollEnabled())
|
| + return;
|
| + if (virtual_keyboard_bounds_ != new_bounds) {
|
| + virtual_keyboard_bounds_ = new_bounds;
|
| + host_->WasResized();
|
| + }
|
| +#endif
|
| +}
|
| +
|
| +////////////////////////////////////////////////////////////////////////////////
|
| // RenderWidgetHostViewAura, aura::client::FocusChangeObserver implementation:
|
|
|
| void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus,
|
| @@ -3520,6 +3551,12 @@ void RenderWidgetHostViewAura::AddedToRootWindow() {
|
| cursor_client->AddObserver(this);
|
| NotifyRendererOfCursorVisibilityState(cursor_client->IsCursorVisible());
|
| }
|
| +
|
| + aura::client::VirtualKeyboardClient* keyboard_client =
|
| + aura::client::GetVirtualKeyboardClient(window_->GetRootWindow());
|
| + if (keyboard_client)
|
| + keyboard_client->AddObserver(this);
|
| +
|
| if (current_surface_.get())
|
| UpdateExternalTexture();
|
| if (HasFocus()) {
|
| @@ -3550,6 +3587,11 @@ void RenderWidgetHostViewAura::RemovingFromRootWindow() {
|
| if (cursor_client)
|
| cursor_client->RemoveObserver(this);
|
|
|
| + aura::client::VirtualKeyboardClient* keyboard_client =
|
| + aura::client::GetVirtualKeyboardClient(window_->GetRootWindow());
|
| + if (keyboard_client)
|
| + keyboard_client->RemoveObserver(this);
|
| +
|
| DetachFromInputMethod();
|
|
|
| window_->GetHost()->RemoveObserver(this);
|
|
|