Index: ui/keyboard/keyboard_controller_proxy.cc |
diff --git a/ui/keyboard/keyboard_controller_proxy.cc b/ui/keyboard/keyboard_controller_proxy.cc |
index 2ade09d540bc80346b675ddf5ea0f05319261210..9ed1197afc457f5485018e3d680f9fa0cc4c0bc4 100644 |
--- a/ui/keyboard/keyboard_controller_proxy.cc |
+++ b/ui/keyboard/keyboard_controller_proxy.cc |
@@ -18,6 +18,7 @@ |
#include "ui/keyboard/keyboard_constants.h" |
#include "ui/keyboard/keyboard_switches.h" |
#include "ui/keyboard/keyboard_util.h" |
+#include "ui/wm/core/shadow.h" |
namespace { |
@@ -119,6 +120,7 @@ aura::Window* KeyboardControllerProxy::GetKeyboardWindow() { |
keyboard_contents_->SetDelegate(new KeyboardContentsDelegate(this)); |
SetupWebContents(keyboard_contents_.get()); |
LoadContents(GetVirtualKeyboardUrl()); |
+ keyboard_contents_->GetNativeView()->AddObserver(this); |
} |
return keyboard_contents_->GetNativeView(); |
@@ -163,4 +165,24 @@ void KeyboardControllerProxy::ReloadKeyboardIfNeeded() { |
void KeyboardControllerProxy::SetupWebContents(content::WebContents* contents) { |
} |
+void KeyboardControllerProxy::OnWindowBoundsChanged( |
+ aura::Window* window, |
+ const gfx::Rect& old_bounds, |
+ const gfx::Rect& new_bounds) { |
+ if (!shadow_) { |
+ shadow_.reset(new wm::Shadow()); |
+ shadow_->Init(wm::Shadow::STYLE_ACTIVE); |
+ shadow_->layer()->SetVisible(true); |
+ DCHECK(keyboard_contents_->GetNativeView()->parent()); |
+ keyboard_contents_->GetNativeView()->parent()->layer()->Add( |
+ shadow_->layer()); |
kevers
2014/05/12 16:15:02
Has the impact of the size change been tested with
bshe
2014/05/12 16:24:43
I tried a11y keyboard and the shadow seems work fi
kevers
2014/05/12 17:10:18
My main concern was whether the top shadow overlap
|
+ } |
+ |
+ shadow_->SetContentBounds(new_bounds); |
+} |
+ |
+void KeyboardControllerProxy::OnWindowDestroyed(aura::Window* window) { |
+ window->RemoveObserver(this); |
+} |
+ |
} // namespace keyboard |