12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file. 42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "ash/test/shell_test_api.h" 62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "ash/root_window_controller.h" 86e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "ash/session/session_state_delegate.h" 9a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "ash/shelf/shelf_delegate.h" 102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "ash/shell.h" 112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#if defined(OS_CHROMEOS) 135c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu#include "ash/display/display_configurator_animation.h" 14c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch#include "ui/display/chromeos/display_configurator.h" 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif 162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace ash { 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace test { 192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)ShellTestApi::ShellTestApi(Shell* shell) : shell_(shell) {} 212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 22c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen MurdochRootWindowLayoutManager* ShellTestApi::root_window_layout() { 232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return shell_->GetPrimaryRootWindowController()->root_window_layout(); 242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)wm::InputMethodEventFilter* 272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)ShellTestApi::input_method_event_filter() { 282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return shell_->input_method_filter_.get(); 292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 31c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen MurdochSystemGestureEventFilter* ShellTestApi::system_gesture_event_filter() { 322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return shell_->system_gesture_filter_.get(); 332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 35c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen MurdochWorkspaceController* ShellTestApi::workspace_controller() { 362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return shell_->GetPrimaryRootWindowController()->workspace_controller(); 372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 39c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen MurdochScreenPositionController* ShellTestApi::screen_position_controller() { 402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return shell_->screen_position_controller_.get(); 412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 422a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)AshNativeCursorManager* ShellTestApi::ash_native_cursor_manager() { 442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) return shell_->native_cursor_manager_; 452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 47f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)ShelfModel* ShellTestApi::shelf_model() { 48f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) return shell_->shelf_model_.get(); 492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 51c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen MurdochDragDropController* ShellTestApi::drag_drop_controller() { 52868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) return shell_->drag_drop_controller_.get(); 53868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)} 54868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 55c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen MurdochAppListController* ShellTestApi::app_list_controller() { 5658537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) return shell_->app_list_controller_.get(); 5758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)} 5858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 595c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liuvoid ShellTestApi::DisableDisplayConfiguratorAnimation() { 602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#if defined(OS_CHROMEOS) 615c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu if (shell_->display_configurator_animation_) { 62c5cede9ae108bb15f6b7a8aea21c7e1fefa2834cBen Murdoch shell_->display_configurator_->RemoveObserver( 635c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu shell_->display_configurator_animation_.get()); 645c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu shell_->display_configurator_animation_.reset(); 652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) } 662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif // defined(OS_CHROMEOS) 672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 69a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)void ShellTestApi::SetShelfDelegate(ShelfDelegate* delegate) { 70a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) shell_->shelf_delegate_.reset(delegate); 71f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)} 72f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 736e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)void ShellTestApi::SetSessionStateDelegate( 746e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) SessionStateDelegate* session_state_delegate) { 756e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) shell_->session_state_delegate_.reset(session_state_delegate); 766e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)} 776e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} // namespace test 792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} // namespace ash 80