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

Unified Diff: ui/keyboard/keyboard_controller_proxy.cc

Issue 280273002: Add default shadow to keyboard window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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
« no previous file with comments | « ui/keyboard/keyboard_controller_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/keyboard/keyboard_controller_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698