• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/display_configurator_animation.h"
13 #include "ui/display/chromeos/display_configurator.h"
14 #endif
15 
16 namespace ash {
17 namespace test {
18 
ShellTestApi(Shell * shell)19 ShellTestApi::ShellTestApi(Shell* shell) : shell_(shell) {}
20 
root_window_layout()21 RootWindowLayoutManager* ShellTestApi::root_window_layout() {
22   return shell_->GetPrimaryRootWindowController()->root_window_layout();
23 }
24 
25 wm::InputMethodEventFilter*
input_method_event_filter()26 ShellTestApi::input_method_event_filter() {
27   return shell_->input_method_filter_.get();
28 }
29 
system_gesture_event_filter()30 SystemGestureEventFilter* ShellTestApi::system_gesture_event_filter() {
31   return shell_->system_gesture_filter_.get();
32 }
33 
workspace_controller()34 WorkspaceController* ShellTestApi::workspace_controller() {
35   return shell_->GetPrimaryRootWindowController()->workspace_controller();
36 }
37 
screen_position_controller()38 ScreenPositionController* ShellTestApi::screen_position_controller() {
39   return shell_->screen_position_controller_.get();
40 }
41 
ash_native_cursor_manager()42 AshNativeCursorManager* ShellTestApi::ash_native_cursor_manager() {
43   return shell_->native_cursor_manager_;
44 }
45 
shelf_model()46 ShelfModel* ShellTestApi::shelf_model() {
47   return shell_->shelf_model_.get();
48 }
49 
drag_drop_controller()50 DragDropController* ShellTestApi::drag_drop_controller() {
51   return shell_->drag_drop_controller_.get();
52 }
53 
app_list_controller()54 AppListController* ShellTestApi::app_list_controller() {
55   return shell_->app_list_controller_.get();
56 }
57 
DisableDisplayConfiguratorAnimation()58 void ShellTestApi::DisableDisplayConfiguratorAnimation() {
59 #if defined(OS_CHROMEOS)
60   if (shell_->display_configurator_animation_) {
61     shell_->display_configurator_->RemoveObserver(
62         shell_->display_configurator_animation_.get());
63     shell_->display_configurator_animation_.reset();
64   }
65 #endif  // defined(OS_CHROMEOS)
66 }
67 
SetShelfDelegate(ShelfDelegate * delegate)68 void ShellTestApi::SetShelfDelegate(ShelfDelegate* delegate) {
69   shell_->shelf_delegate_.reset(delegate);
70 }
71 
72 }  // namespace test
73 }  // namespace ash
74