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

Unified Diff: ui/keyboard/keyboard_controller.cc

Issue 341573002: keyboard: Fix hit-testing code to not create the keyboard window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « no previous file | ui/keyboard/keyboard_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_controller.cc
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index e43e036e2d6aee61566f0e6a78d7b9709d60e0a6..f8889797606b857db61168d1a811fafddb9623e3 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -58,6 +58,8 @@ class KeyboardContainerTargeter : public wm::MaskedWindowTargeter {
// wm::MaskedWindowTargeter:
virtual bool GetHitTestMask(aura::Window* window,
gfx::Path* mask) const OVERRIDE {
+ if (proxy_ && !proxy_->HasKeyboardWindow())
+ return true;
gfx::Rect keyboard_bounds = proxy_ ? proxy_->GetKeyboardWindow()->bounds() :
keyboard::DefaultKeyboardBoundsFromWindowBounds(window->bounds());
mask->addRect(RectToSkRect(keyboard_bounds));
@@ -105,8 +107,12 @@ class KeyboardWindowDelegate : public aura::WindowDelegate {
virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {}
virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE { delete this; }
virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {}
- virtual bool HasHitTestMask() const OVERRIDE { return true; }
+ virtual bool HasHitTestMask() const OVERRIDE {
+ return !proxy_ || proxy_->HasKeyboardWindow();
+ }
virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {
+ if (proxy_ && !proxy_->HasKeyboardWindow())
+ return;
gfx::Rect keyboard_bounds = proxy_ ? proxy_->GetKeyboardWindow()->bounds() :
keyboard::DefaultKeyboardBoundsFromWindowBounds(bounds_);
mask->addRect(RectToSkRect(keyboard_bounds));
« no previous file with comments | « no previous file | ui/keyboard/keyboard_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698