OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/keyboard/keyboard_controller.h" | 5 #include "ui/keyboard/keyboard_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 class KeyboardContainerObserver : public aura::WindowObserver { | 149 class KeyboardContainerObserver : public aura::WindowObserver { |
150 public: | 150 public: |
151 explicit KeyboardContainerObserver(aura::Window* window) : window_(window) { | 151 explicit KeyboardContainerObserver(aura::Window* window) : window_(window) { |
152 window_->AddObserver(this); | 152 window_->AddObserver(this); |
153 } | 153 } |
154 ~KeyboardContainerObserver() override { window_->RemoveObserver(this); } | 154 ~KeyboardContainerObserver() override { window_->RemoveObserver(this); } |
155 | 155 |
156 private: | 156 private: |
157 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override { | 157 void OnWindowVisibilityChanged(aura::Window* window, bool visible) override { |
158 if (!visible) | 158 if (!visible) |
159 base::MessageLoop::current()->Quit(); | 159 base::MessageLoop::current()->QuitWhenIdle(); |
160 } | 160 } |
161 | 161 |
162 aura::Window* window_; | 162 aura::Window* window_; |
163 | 163 |
164 DISALLOW_COPY_AND_ASSIGN(KeyboardContainerObserver); | 164 DISALLOW_COPY_AND_ASSIGN(KeyboardContainerObserver); |
165 }; | 165 }; |
166 | 166 |
167 } // namespace | 167 } // namespace |
168 | 168 |
169 class KeyboardControllerTest : public testing::Test, | 169 class KeyboardControllerTest : public testing::Test, |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 // Before hide animation finishes, show keyboard again. | 607 // Before hide animation finishes, show keyboard again. |
608 ShowKeyboard(); | 608 ShowKeyboard(); |
609 RunAnimationForLayer(layer); | 609 RunAnimationForLayer(layer); |
610 EXPECT_TRUE(keyboard_container()->IsVisible()); | 610 EXPECT_TRUE(keyboard_container()->IsVisible()); |
611 EXPECT_TRUE(keyboard_window()->IsVisible()); | 611 EXPECT_TRUE(keyboard_window()->IsVisible()); |
612 EXPECT_EQ(1.0, layer->opacity()); | 612 EXPECT_EQ(1.0, layer->opacity()); |
613 EXPECT_EQ(gfx::Transform(), layer->transform()); | 613 EXPECT_EQ(gfx::Transform(), layer->transform()); |
614 } | 614 } |
615 | 615 |
616 } // namespace keyboard | 616 } // namespace keyboard |
OLD | NEW |