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

Side by Side Diff: ash/test/ash_test_base.cc

Issue 2872343003: Remove InputMethodEventHandler. (Closed)
Patch Set: addressed feedback. Created 3 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 unified diff | Download patch
« no previous file with comments | « ash/shell.cc ('k') | extensions/shell/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/test/ash_test_base.h" 5 #include "ash/test/ash_test_base.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/display/extended_mouse_warp_controller.h" 10 #include "ash/display/extended_mouse_warp_controller.h"
11 #include "ash/display/mouse_cursor_event_filter.h" 11 #include "ash/display/mouse_cursor_event_filter.h"
12 #include "ash/display/unified_mouse_warp_controller.h" 12 #include "ash/display/unified_mouse_warp_controller.h"
13 #include "ash/display/window_tree_host_manager.h" 13 #include "ash/display/window_tree_host_manager.h"
14 #include "ash/ime/input_method_event_handler.h"
15 #include "ash/mus/top_level_window_factory.h" 14 #include "ash/mus/top_level_window_factory.h"
16 #include "ash/mus/window_manager.h" 15 #include "ash/mus/window_manager.h"
17 #include "ash/mus/window_manager_application.h" 16 #include "ash/mus/window_manager_application.h"
18 #include "ash/public/cpp/config.h" 17 #include "ash/public/cpp/config.h"
19 #include "ash/public/cpp/window_properties.h" 18 #include "ash/public/cpp/window_properties.h"
20 #include "ash/root_window_controller.h" 19 #include "ash/root_window_controller.h"
21 #include "ash/session/session_controller.h" 20 #include "ash/session/session_controller.h"
22 #include "ash/shell.h" 21 #include "ash/shell.h"
23 #include "ash/shell/toplevel_window.h" 22 #include "ash/shell/toplevel_window.h"
24 #include "ash/shell_port.h" 23 #include "ash/shell_port.h"
25 #include "ash/test/ash_test_environment.h" 24 #include "ash/test/ash_test_environment.h"
26 #include "ash/test/ash_test_helper.h" 25 #include "ash/test/ash_test_helper.h"
27 #include "ash/test/test_session_controller_client.h" 26 #include "ash/test/test_session_controller_client.h"
28 #include "ash/test/test_shell_delegate.h" 27 #include "ash/test/test_shell_delegate.h"
29 #include "ash/test/test_system_tray_delegate.h" 28 #include "ash/test/test_system_tray_delegate.h"
30 #include "ash/wm/window_positioner.h" 29 #include "ash/wm/window_positioner.h"
31 #include "ash/wm_window.h" 30 #include "ash/wm_window.h"
32 #include "services/ui/public/cpp/property_type_converters.h" 31 #include "services/ui/public/cpp/property_type_converters.h"
33 #include "services/ui/public/interfaces/window_manager.mojom.h" 32 #include "services/ui/public/interfaces/window_manager.mojom.h"
34 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" 33 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
35 #include "ui/aura/client/aura_constants.h" 34 #include "ui/aura/client/aura_constants.h"
36 #include "ui/aura/client/screen_position_client.h" 35 #include "ui/aura/client/screen_position_client.h"
37 #include "ui/aura/client/window_parenting_client.h" 36 #include "ui/aura/client/window_parenting_client.h"
38 #include "ui/aura/env.h" 37 #include "ui/aura/env.h"
39 #include "ui/aura/mus/property_converter.h" 38 #include "ui/aura/mus/property_converter.h"
39 #include "ui/aura/test/aura_test_utils.h"
40 #include "ui/aura/test/event_generator_delegate_aura.h" 40 #include "ui/aura/test/event_generator_delegate_aura.h"
41 #include "ui/aura/test/test_window_delegate.h" 41 #include "ui/aura/test/test_window_delegate.h"
42 #include "ui/aura/window.h" 42 #include "ui/aura/window.h"
43 #include "ui/aura/window_delegate.h" 43 #include "ui/aura/window_delegate.h"
44 #include "ui/aura/window_tree_host.h" 44 #include "ui/aura/window_tree_host.h"
45 #include "ui/base/ime/input_method_initializer.h" 45 #include "ui/base/ime/input_method_initializer.h"
46 #include "ui/display/display.h" 46 #include "ui/display/display.h"
47 #include "ui/display/screen.h" 47 #include "ui/display/screen.h"
48 #include "ui/display/test/display_manager_test_api.h" 48 #include "ui/display/test/display_manager_test_api.h"
49 #include "ui/display/types/display_constants.h" 49 #include "ui/display/types/display_constants.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 break; 447 break;
448 } 448 }
449 } 449 }
450 450
451 void AshTestBase::UnblockUserSession() { 451 void AshTestBase::UnblockUserSession() {
452 SetSessionStarted(true); 452 SetSessionStarted(true);
453 GetSessionControllerClient()->UnlockScreen(); 453 GetSessionControllerClient()->UnlockScreen();
454 } 454 }
455 455
456 void AshTestBase::DisableIME() { 456 void AshTestBase::DisableIME() {
457 // WindowTreeHostManager isn't applicable to mash and IME is routed 457 aura::test::DisableIME(Shell::GetPrimaryRootWindow()->GetHost());
458 // differently in mash.
459 if (Shell::GetAshConfig() == Config::MASH)
460 return;
461
462 Shell::Get()->RemovePreTargetHandler(
463 Shell::Get()->window_tree_host_manager()->input_method_event_handler());
464 } 458 }
465 459
466 display::DisplayManager* AshTestBase::display_manager() { 460 display::DisplayManager* AshTestBase::display_manager() {
467 return Shell::Get()->display_manager(); 461 return Shell::Get()->display_manager();
468 } 462 }
469 463
470 bool AshTestBase::TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator, 464 bool AshTestBase::TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator,
471 const gfx::Point& point_in_screen) { 465 const gfx::Point& point_in_screen) {
472 DCHECK(!Shell::Get()->display_manager()->IsInUnifiedMode()); 466 DCHECK(!Shell::Get()->display_manager()->IsInUnifiedMode());
473 static_cast<ExtendedMouseWarpController*>( 467 static_cast<ExtendedMouseWarpController*>(
(...skipping 21 matching lines...) Expand all
495 return display::Screen::GetScreen()->GetDisplayNearestWindow( 489 return display::Screen::GetScreen()->GetDisplayNearestWindow(
496 Shell::GetPrimaryRootWindow()); 490 Shell::GetPrimaryRootWindow());
497 } 491 }
498 492
499 display::Display AshTestBase::GetSecondaryDisplay() { 493 display::Display AshTestBase::GetSecondaryDisplay() {
500 return ash_test_helper_->GetSecondaryDisplay(); 494 return ash_test_helper_->GetSecondaryDisplay();
501 } 495 }
502 496
503 } // namespace test 497 } // namespace test
504 } // namespace ash 498 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | extensions/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698