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