blob: 8233124a11143718a2983ca24eb9ccab1c464344 [file] [log] [blame]
[email protected]0c68e892012-12-08 16:54:531// 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
James Cook346c8c62017-07-18 19:38:375#include "ash/shell_test_api.h"
sky5ad143a2017-03-22 04:31:236
xiyuan317fdbe2017-05-31 15:02:027#include <utility>
8
James Cookb0bf8e82017-04-09 17:01:449#include "ash/palette_delegate.h"
[email protected]0c68e892012-12-08 16:54:5310#include "ash/root_window_controller.h"
11#include "ash/shell.h"
Qiang Xu50c6f8c2017-08-31 20:55:2412#include "ash/wm/power_button_controller.h"
James Cookbbe5cb12017-08-08 18:32:2113#include "components/prefs/testing_pref_service.h"
[email protected]0c68e892012-12-08 16:54:5314
15namespace ash {
[email protected]0c68e892012-12-08 16:54:5316
skycb4be5b2017-04-06 17:52:4517ShellTestApi::ShellTestApi() : ShellTestApi(Shell::Get()) {}
sky07a24d42017-03-09 23:57:3018
[email protected]0c68e892012-12-08 16:54:5319ShellTestApi::ShellTestApi(Shell* shell) : shell_(shell) {}
20
[email protected]093b8d642014-04-03 20:59:2821SystemGestureEventFilter* ShellTestApi::system_gesture_event_filter() {
[email protected]0c68e892012-12-08 16:54:5322 return shell_->system_gesture_filter_.get();
23}
24
[email protected]093b8d642014-04-03 20:59:2825WorkspaceController* ShellTestApi::workspace_controller() {
[email protected]0c68e892012-12-08 16:54:5326 return shell_->GetPrimaryRootWindowController()->workspace_controller();
27}
28
[email protected]093b8d642014-04-03 20:59:2829ScreenPositionController* ShellTestApi::screen_position_controller() {
[email protected]0c68e892012-12-08 16:54:5330 return shell_->screen_position_controller_.get();
31}
32
erg36cfb952017-06-21 19:41:4533NativeCursorManagerAsh* ShellTestApi::native_cursor_manager_ash() {
[email protected]c0ff0342013-02-27 00:41:2934 return shell_->native_cursor_manager_;
35}
36
[email protected]093b8d642014-04-03 20:59:2837DragDropController* ShellTestApi::drag_drop_controller() {
[email protected]c086bab2013-06-06 21:46:4438 return shell_->drag_drop_controller_.get();
39}
40
sky07a24d42017-03-09 23:57:3041void ShellTestApi::SetPaletteDelegate(
42 std::unique_ptr<PaletteDelegate> palette_delegate) {
43 shell_->palette_delegate_ = std::move(palette_delegate);
44}
45
James Cookbbe5cb12017-08-08 18:32:2146void ShellTestApi::OnLocalStatePrefServiceInitialized(
47 std::unique_ptr<PrefService> pref_service) {
48 shell_->OnLocalStatePrefServiceInitialized(std::move(pref_service));
49}
50
Qiang Xu50c6f8c2017-08-31 20:55:2451void ShellTestApi::ResetPowerButtonControllerForTest() {
52 shell_->power_button_controller_ =
53 std::make_unique<PowerButtonController>(shell_->lock_state_controller());
54}
55
[email protected]0c68e892012-12-08 16:54:5356} // namespace ash