[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 | #ifndef ASH_SHELL_TEST_API_H_ |
6 | #define ASH_SHELL_TEST_API_H_ | ||||
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 7 | |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 8 | #include <memory> |
9 | |||||
James Cook | 00848f0 | 2018-01-05 18:02:57 | [diff] [blame] | 10 | #include "ash/public/interfaces/shell_test_api.mojom.h" |
avi | db567a8a | 2015-12-20 17:07:24 | [diff] [blame] | 11 | #include "base/macros.h" |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 12 | |
James Cook | bbe5cb1 | 2017-08-08 18:32:21 | [diff] [blame] | 13 | class PrefService; |
14 | |||||
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 15 | namespace ash { |
[email protected] | c086bab | 2013-06-06 21:46:44 | [diff] [blame] | 16 | class DragDropController; |
James Cook | 459354b3 | 2017-09-27 23:18:01 | [diff] [blame] | 17 | class MessageCenterController; |
18 | class NativeCursorManagerAsh; | ||||
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 19 | class ScreenPositionController; |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 20 | class Shell; |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 21 | class SystemGestureEventFilter; |
22 | class WorkspaceController; | ||||
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 23 | |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 24 | // Accesses private data from a Shell for testing. |
James Cook | 00848f0 | 2018-01-05 18:02:57 | [diff] [blame] | 25 | class ShellTestApi : public mojom::ShellTestApi { |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 26 | public: |
sky | 07a24d4 | 2017-03-09 23:57:30 | [diff] [blame] | 27 | ShellTestApi(); |
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 28 | explicit ShellTestApi(Shell* shell); |
29 | |||||
James Cook | 00848f0 | 2018-01-05 18:02:57 | [diff] [blame] | 30 | // Creates and binds an instance from a remote request (e.g. from chrome). |
31 | static void BindRequest(mojom::ShellTestApiRequest request); | ||||
32 | |||||
James Cook | 459354b3 | 2017-09-27 23:18:01 | [diff] [blame] | 33 | MessageCenterController* message_center_controller(); |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 34 | SystemGestureEventFilter* system_gesture_event_filter(); |
35 | WorkspaceController* workspace_controller(); | ||||
36 | ScreenPositionController* screen_position_controller(); | ||||
erg | 36cfb95 | 2017-06-21 19:41:45 | [diff] [blame] | 37 | NativeCursorManagerAsh* native_cursor_manager_ash(); |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 38 | DragDropController* drag_drop_controller(); |
[email protected] | 945ece96 | 2013-03-21 06:42:39 | [diff] [blame] | 39 | |
James Cook | bbe5cb1 | 2017-08-08 18:32:21 | [diff] [blame] | 40 | // Calls the private method. |
41 | void OnLocalStatePrefServiceInitialized( | ||||
42 | std::unique_ptr<PrefService> pref_service); | ||||
43 | |||||
Qiang Xu | 50c6f8c | 2017-08-31 20:55:24 | [diff] [blame] | 44 | // Resets |shell_->power_button_controller_| to hold a new object to simulate |
45 | // Chrome starting. | ||||
46 | void ResetPowerButtonControllerForTest(); | ||||
47 | |||||
James Cook | 7b7c6a5 | 2018-01-04 23:40:03 | [diff] [blame] | 48 | // Simulates a modal dialog being open. |
49 | void SimulateModalWindowOpenForTest(bool modal_window_open); | ||||
50 | |||||
James Cook | 00848f0 | 2018-01-05 18:02:57 | [diff] [blame] | 51 | // mojom::ShellTestApi: |
52 | void IsSystemModalWindowOpen(IsSystemModalWindowOpenCallback cb) override; | ||||
53 | |||||
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 54 | private: |
55 | Shell* shell_; // not owned | ||||
56 | |||||
57 | DISALLOW_COPY_AND_ASSIGN(ShellTestApi); | ||||
58 | }; | ||||
59 | |||||
[email protected] | 0c68e89 | 2012-12-08 16:54:53 | [diff] [blame] | 60 | } // namespace ash |
61 | |||||
James Cook | 346c8c6 | 2017-07-18 19:38:37 | [diff] [blame] | 62 | #endif // ASH_SHELL_TEST_API_H_ |