Home | History | Annotate | Download | only in test
      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/shell.h"
      9 
     10 #if defined(OS_CHROMEOS)
     11 #include "ash/display/output_configurator_animation.h"
     12 #include "chromeos/display/output_configurator.h"
     13 #endif
     14 
     15 namespace ash {
     16 namespace test {
     17 
     18 ShellTestApi::ShellTestApi(Shell* shell) : shell_(shell) {}
     19 
     20 internal::RootWindowLayoutManager* ShellTestApi::root_window_layout() {
     21   return shell_->GetPrimaryRootWindowController()->root_window_layout();
     22 }
     23 
     24 views::corewm::InputMethodEventFilter*
     25 ShellTestApi::input_method_event_filter() {
     26   return shell_->input_method_filter_.get();
     27 }
     28 
     29 internal::SystemGestureEventFilter*
     30 ShellTestApi::system_gesture_event_filter() {
     31   return shell_->system_gesture_filter_.get();
     32 }
     33 
     34 internal::WorkspaceController* ShellTestApi::workspace_controller() {
     35   return shell_->GetPrimaryRootWindowController()->workspace_controller();
     36 }
     37 
     38 internal::ScreenPositionController*
     39 ShellTestApi::screen_position_controller() {
     40   return shell_->screen_position_controller_.get();
     41 }
     42 
     43 AshNativeCursorManager* ShellTestApi::ash_native_cursor_manager() {
     44   return shell_->native_cursor_manager_;
     45 }
     46 
     47 LauncherModel* ShellTestApi::launcher_model() {
     48   return shell_->launcher_model_.get();
     49 }
     50 
     51 internal::DragDropController* ShellTestApi::drag_drop_controller() {
     52   return shell_->drag_drop_controller_.get();
     53 }
     54 
     55 void ShellTestApi::DisableOutputConfiguratorAnimation() {
     56 #if defined(OS_CHROMEOS)
     57   if (shell_->output_configurator_animation_) {
     58     shell_->output_configurator_->RemoveObserver(
     59         shell_->output_configurator_animation_.get());
     60     shell_->output_configurator_animation_.reset();
     61   }
     62 #endif  // defined(OS_CHROMEOS)
     63 }
     64 
     65 }  // namespace test
     66 }  // namespace ash
     67