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

Side by Side Diff: ash/wm/system_modal_container_layout_manager_unittest.cc

Issue 1392713002: Extract content dependency from keyboard code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « ash/wm/lock_layout_manager_unittest.cc ('k') | chrome/browser/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/session_state_delegate.h" 8 #include "ash/session/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"
11 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
12 #include "ash/wm/window_util.h" 12 #include "ash/wm/window_util.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/run_loop.h" 15 #include "base/run_loop.h"
16 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
17 #include "ui/aura/window_event_dispatcher.h" 17 #include "ui/aura/window_event_dispatcher.h"
18 #include "ui/compositor/layer.h" 18 #include "ui/compositor/layer.h"
19 #include "ui/compositor/scoped_animation_duration_scale_mode.h" 19 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
20 #include "ui/compositor/test/layer_animator_test_controller.h" 20 #include "ui/compositor/test/layer_animator_test_controller.h"
21 #include "ui/events/test/event_generator.h" 21 #include "ui/events/test/event_generator.h"
22 #include "ui/gfx/screen.h" 22 #include "ui/gfx/screen.h"
23 #include "ui/keyboard/keyboard_controller.h" 23 #include "ui/keyboard/keyboard_controller.h"
24 #include "ui/keyboard/keyboard_controller_proxy.h"
25 #include "ui/keyboard/keyboard_switches.h" 24 #include "ui/keyboard/keyboard_switches.h"
25 #include "ui/keyboard/keyboard_ui.h"
26 #include "ui/keyboard/keyboard_util.h" 26 #include "ui/keyboard/keyboard_util.h"
27 #include "ui/views/test/capture_tracking_view.h" 27 #include "ui/views/test/capture_tracking_view.h"
28 #include "ui/views/widget/widget.h" 28 #include "ui/views/widget/widget.h"
29 #include "ui/views/widget/widget_delegate.h" 29 #include "ui/views/widget/widget_delegate.h"
30 #include "ui/wm/core/window_util.h" 30 #include "ui/wm/core/window_util.h"
31 31
32 namespace ash { 32 namespace ash {
33 namespace test { 33 namespace test {
34 34
35 namespace { 35 namespace {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // Show or hide the keyboard. 173 // Show or hide the keyboard.
174 void ShowKeyboard(bool show) { 174 void ShowKeyboard(bool show) {
175 keyboard::KeyboardController* keyboard = 175 keyboard::KeyboardController* keyboard =
176 keyboard::KeyboardController::GetInstance(); 176 keyboard::KeyboardController::GetInstance();
177 ASSERT_TRUE(keyboard); 177 ASSERT_TRUE(keyboard);
178 if (show == keyboard->keyboard_visible()) 178 if (show == keyboard->keyboard_visible())
179 return; 179 return;
180 180
181 if (show) { 181 if (show) {
182 keyboard->ShowKeyboard(true); 182 keyboard->ShowKeyboard(true);
183 if (keyboard->proxy()->GetKeyboardWindow()->bounds().height() == 0) { 183 if (keyboard->ui()->GetKeyboardWindow()->bounds().height() == 0) {
184 keyboard->proxy()->GetKeyboardWindow()->SetBounds( 184 keyboard->ui()->GetKeyboardWindow()->SetBounds(
185 keyboard::FullWidthKeyboardBoundsFromRootBounds( 185 keyboard::FullWidthKeyboardBoundsFromRootBounds(
186 Shell::GetPrimaryRootWindow()->bounds(), 100)); 186 Shell::GetPrimaryRootWindow()->bounds(), 100));
187 } 187 }
188 } else { 188 } else {
189 keyboard->HideKeyboard(keyboard::KeyboardController::HIDE_REASON_MANUAL); 189 keyboard->HideKeyboard(keyboard::KeyboardController::HIDE_REASON_MANUAL);
190 } 190 }
191 191
192 DCHECK_EQ(show, keyboard->keyboard_visible()); 192 DCHECK_EQ(show, keyboard->keyboard_visible());
193 } 193 }
194 194
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 ShowKeyboard(true); 644 ShowKeyboard(true);
645 EXPECT_EQ(modal_size.ToString(), modal_window->bounds().size().ToString()); 645 EXPECT_EQ(modal_size.ToString(), modal_window->bounds().size().ToString());
646 EXPECT_EQ(modal_origin.x(), modal_window->bounds().x()); 646 EXPECT_EQ(modal_origin.x(), modal_window->bounds().x());
647 EXPECT_EQ(0, modal_window->bounds().y()); 647 EXPECT_EQ(0, modal_window->bounds().y());
648 648
649 ShowKeyboard(false); 649 ShowKeyboard(false);
650 } 650 }
651 651
652 } // namespace test 652 } // namespace test
653 } // namespace ash 653 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/lock_layout_manager_unittest.cc ('k') | chrome/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698