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 3 // found in the LICENSE file. 4 5 #include "ash/test/shell_test_api.h" 6 7 #include "ash/root_window_controller.h" 8 #include "ash/shelf/shelf_delegate.h" 9 #include "ash/shell.h" 10 11 #if defined(OS_CHROMEOS) 12 #include "ash/display/output_configurator_animation.h" 13 #include "chromeos/display/output_configurator.h" 14 #endif 15 16 namespace ash { 17 namespace test { 18 19 ShellTestApi::ShellTestApi(Shell* shell) : shell_(shell) {} 20 21 internal::RootWindowLayoutManager* ShellTestApi::root_window_layout() { 22 return shell_->GetPrimaryRootWindowController()->root_window_layout(); 23 } 24 25 views::corewm::InputMethodEventFilter* 26 ShellTestApi::input_method_event_filter() { 27 return shell_->input_method_filter_.get(); 28 } 29 30 internal::SystemGestureEventFilter* 31 ShellTestApi::system_gesture_event_filter() { 32 return shell_->system_gesture_filter_.get(); 33 } 34 35 internal::WorkspaceController* ShellTestApi::workspace_controller() { 36 return shell_->GetPrimaryRootWindowController()->workspace_controller(); 37 } 38 39 internal::ScreenPositionController* 40 ShellTestApi::screen_position_controller() { 41 return shell_->screen_position_controller_.get(); 42 } 43 44 AshNativeCursorManager* ShellTestApi::ash_native_cursor_manager() { 45 return shell_->native_cursor_manager_; 46 } 47 48 ShelfModel* ShellTestApi::shelf_model() { 49 return shell_->shelf_model_.get(); 50 } 51 52 internal::DragDropController* ShellTestApi::drag_drop_controller() { 53 return shell_->drag_drop_controller_.get(); 54 } 55 56 internal::AppListController* ShellTestApi::app_list_controller() { 57 return shell_->app_list_controller_.get(); 58 } 59 60 void ShellTestApi::DisableOutputConfiguratorAnimation() { 61 #if defined(OS_CHROMEOS) 62 if (shell_->output_configurator_animation_) { 63 shell_->output_configurator_->RemoveObserver( 64 shell_->output_configurator_animation_.get()); 65 shell_->output_configurator_animation_.reset(); 66 } 67 #endif // defined(OS_CHROMEOS) 68 } 69 70 void ShellTestApi::SetShelfDelegate(ShelfDelegate* delegate) { 71 shell_->shelf_delegate_.reset(delegate); 72 } 73 74 } // namespace test 75 } // namespace ash 76