[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 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 | |||||
James Cook | 346c8c6 | 2017-07-18 19:38:37 | [diff] [blame] | 5 | #include "ash/shell_test_api.h" |
sky | 5ad143a | 2017-03-22 04:31:23 | [diff] [blame] | 6 | |
xiyuan | 317fdbe | 2017-05-31 15:02:02 | [diff] [blame] | 7 | #include <utility> |
8 | |||||
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 9 | #include "ash/palette_delegate.h" |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 10 | #include "ash/root_window_controller.h" |
11 | #include "ash/shell.h" | ||||
Qiang Xu | 50c6f8c | 2017-08-31 20:55:24 | [diff] [blame^] | 12 | #include "ash/wm/power_button_controller.h" |
James Cook | bbe5cb1 | 2017-08-08 18:32:21 | [diff] [blame] | 13 | #include "components/prefs/testing_pref_service.h" |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 14 | |
15 | namespace ash { | ||||
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 16 | |
sky | cb4be5b | 2017-04-06 17:52:45 | [diff] [blame] | 17 | ShellTestApi::ShellTestApi() : ShellTestApi(Shell::Get()) {} |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 18 | |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 19 | ShellTestApi::ShellTestApi(Shell* shell) : shell_(shell) {} |
20 | |||||
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 21 | SystemGestureEventFilter* ShellTestApi::system_gesture_event_filter() { |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 22 | return shell_->system_gesture_filter_.get(); |
23 | } | ||||
24 | |||||
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 25 | WorkspaceController* ShellTestApi::workspace_controller() { |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 26 | return shell_->GetPrimaryRootWindowController()->workspace_controller(); |
27 | } | ||||
28 | |||||
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 29 | ScreenPositionController* ShellTestApi::screen_position_controller() { |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 30 | return shell_->screen_position_controller_.get(); |
31 | } | ||||
32 | |||||
erg | 36cfb95 | 2017-06-21 19:41:45 | [diff] [blame] | 33 | NativeCursorManagerAsh* ShellTestApi::native_cursor_manager_ash() { |
[email protected] | c0ff034 | 2013-02-27 00:41:29 | [diff] [blame] | 34 | return shell_->native_cursor_manager_; |
35 | } | ||||
36 | |||||
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 37 | DragDropController* ShellTestApi::drag_drop_controller() { |
[email protected] | c086bab | 2013-06-06 21:46:44 | [diff] [blame] | 38 | return shell_->drag_drop_controller_.get(); |
39 | } | ||||
40 | |||||
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 41 | void ShellTestApi::SetPaletteDelegate( |
42 | std::unique_ptr<PaletteDelegate> palette_delegate) { | ||||
43 | shell_->palette_delegate_ = std::move(palette_delegate); | ||||
44 | } | ||||
45 | |||||
James Cook | bbe5cb1 | 2017-08-08 18:32:21 | [diff] [blame] | 46 | void ShellTestApi::OnLocalStatePrefServiceInitialized( |
47 | std::unique_ptr<PrefService> pref_service) { | ||||
48 | shell_->OnLocalStatePrefServiceInitialized(std::move(pref_service)); | ||||
49 | } | ||||
50 | |||||
Qiang Xu | 50c6f8c | 2017-08-31 20:55:24 | [diff] [blame^] | 51 | void ShellTestApi::ResetPowerButtonControllerForTest() { |
52 | shell_->power_button_controller_ = | ||||
53 | std::make_unique<PowerButtonController>(shell_->lock_state_controller()); | ||||
54 | } | ||||
55 | |||||
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 56 | } // namespace ash |