OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/wm/system_modal_container_layout_manager.h" | 5 #include "ash/wm/system_modal_container_layout_manager.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/session_state_delegate.h" | 8 #include "ash/session_state_delegate.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 keyboard::KeyboardController::GetInstance(); | 182 keyboard::KeyboardController::GetInstance(); |
183 ASSERT_TRUE(keyboard); | 183 ASSERT_TRUE(keyboard); |
184 if (show == keyboard->keyboard_visible()) | 184 if (show == keyboard->keyboard_visible()) |
185 return; | 185 return; |
186 | 186 |
187 // The animation has to run in order to get the notification. Run the | 187 // The animation has to run in order to get the notification. Run the |
188 // animation and wait until its finished. | 188 // animation and wait until its finished. |
189 ui::ScopedAnimationDurationScaleMode normal_duration_mode( | 189 ui::ScopedAnimationDurationScaleMode normal_duration_mode( |
190 ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); | 190 ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); |
191 if (show) | 191 if (show) |
192 keyboard->ShowAndLockKeyboard(); | 192 keyboard->ShowKeyboard(true); |
193 else | 193 else |
194 keyboard->HideKeyboard(keyboard::KeyboardController::HIDE_REASON_MANUAL); | 194 keyboard->HideKeyboard(keyboard::KeyboardController::HIDE_REASON_MANUAL); |
195 | 195 |
196 WaitForWindowAnimationToBeFinished(keyboard->GetContainerWindow()); | 196 WaitForWindowAnimationToBeFinished(keyboard->GetContainerWindow()); |
197 | 197 |
198 DCHECK_EQ(show, keyboard->keyboard_visible()); | 198 DCHECK_EQ(show, keyboard->keyboard_visible()); |
199 } | 199 } |
200 | 200 |
201 void WaitForWindowAnimationToBeFinished(aura::Window* window) { | 201 void WaitForWindowAnimationToBeFinished(aura::Window* window) { |
202 DCHECK(window); | 202 DCHECK(window); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 | 580 |
581 // After the keyboard is gone, the window will remain where it was. | 581 // After the keyboard is gone, the window will remain where it was. |
582 ShowKeyboard(false); | 582 ShowKeyboard(false); |
583 EXPECT_NE(modal_bounds.ToString(), modal_window->bounds().ToString()); | 583 EXPECT_NE(modal_bounds.ToString(), modal_window->bounds().ToString()); |
584 EXPECT_EQ(modal_size.ToString(), modal_window->bounds().size().ToString()); | 584 EXPECT_EQ(modal_size.ToString(), modal_window->bounds().size().ToString()); |
585 EXPECT_EQ(modal_origin.x(), modal_window->bounds().x()); | 585 EXPECT_EQ(modal_origin.x(), modal_window->bounds().x()); |
586 } | 586 } |
587 | 587 |
588 } // namespace test | 588 } // namespace test |
589 } // namespace ash | 589 } // namespace ash |
OLD | NEW |