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

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

Issue 2872343003: Remove InputMethodEventHandler. (Closed)
Patch Set: Add a unittest. 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
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"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 NOTREACHED(); 445 NOTREACHED();
447 break; 446 break;
448 } 447 }
449 } 448 }
450 449
451 void AshTestBase::UnblockUserSession() { 450 void AshTestBase::UnblockUserSession() {
452 SetSessionStarted(true); 451 SetSessionStarted(true);
453 GetSessionControllerClient()->UnlockScreen(); 452 GetSessionControllerClient()->UnlockScreen();
454 } 453 }
455 454
456 void AshTestBase::DisableIME() {
457 // WindowTreeHostManager isn't applicable to mash and IME is routed
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 }
465
466 display::DisplayManager* AshTestBase::display_manager() { 455 display::DisplayManager* AshTestBase::display_manager() {
467 return Shell::Get()->display_manager(); 456 return Shell::Get()->display_manager();
468 } 457 }
469 458
470 bool AshTestBase::TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator, 459 bool AshTestBase::TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator,
471 const gfx::Point& point_in_screen) { 460 const gfx::Point& point_in_screen) {
472 DCHECK(!Shell::Get()->display_manager()->IsInUnifiedMode()); 461 DCHECK(!Shell::Get()->display_manager()->IsInUnifiedMode());
473 static_cast<ExtendedMouseWarpController*>( 462 static_cast<ExtendedMouseWarpController*>(
474 Shell::Get()->mouse_cursor_filter()->mouse_warp_controller_for_test()) 463 Shell::Get()->mouse_cursor_filter()->mouse_warp_controller_for_test())
475 ->allow_non_native_event_for_test(); 464 ->allow_non_native_event_for_test();
(...skipping 19 matching lines...) Expand all
495 return display::Screen::GetScreen()->GetDisplayNearestWindow( 484 return display::Screen::GetScreen()->GetDisplayNearestWindow(
496 Shell::GetPrimaryRootWindow()); 485 Shell::GetPrimaryRootWindow());
497 } 486 }
498 487
499 display::Display AshTestBase::GetSecondaryDisplay() { 488 display::Display AshTestBase::GetSecondaryDisplay() {
500 return ash_test_helper_->GetSecondaryDisplay(); 489 return ash_test_helper_->GetSecondaryDisplay();
501 } 490 }
502 491
503 } // namespace test 492 } // namespace test
504 } // namespace ash 493 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698