blob: 1decb1c662249c739467b3b610c1ea77cb8989c6 [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#ifndef ASH_SHELL_TEST_API_H_
6#define ASH_SHELL_TEST_API_H_
[email protected]0c68e892012-12-08 16:54:537
sky07a24d42017-03-09 23:57:308#include <memory>
9
James Cook00848f02018-01-05 18:02:5710#include "ash/public/interfaces/shell_test_api.mojom.h"
avidb567a8a2015-12-20 17:07:2411#include "base/macros.h"
[email protected]0c68e892012-12-08 16:54:5312
James Cookbbe5cb12017-08-08 18:32:2113class PrefService;
14
[email protected]0c68e892012-12-08 16:54:5315namespace ash {
[email protected]c086bab2013-06-06 21:46:4416class DragDropController;
James Cook459354b32017-09-27 23:18:0117class MessageCenterController;
18class NativeCursorManagerAsh;
Qiang Xu36234e532018-04-11 04:54:0219class PowerPrefs;
[email protected]0c68e892012-12-08 16:54:5320class ScreenPositionController;
[email protected]093b8d642014-04-03 20:59:2821class Shell;
[email protected]0c68e892012-12-08 16:54:5322class SystemGestureEventFilter;
23class WorkspaceController;
[email protected]0c68e892012-12-08 16:54:5324
[email protected]0c68e892012-12-08 16:54:5325// Accesses private data from a Shell for testing.
James Cook00848f02018-01-05 18:02:5726class ShellTestApi : public mojom::ShellTestApi {
jamescookb8dcef522016-06-25 14:42:5527 public:
sky07a24d42017-03-09 23:57:3028 ShellTestApi();
[email protected]0c68e892012-12-08 16:54:5329 explicit ShellTestApi(Shell* shell);
30
James Cook00848f02018-01-05 18:02:5731 // Creates and binds an instance from a remote request (e.g. from chrome).
32 static void BindRequest(mojom::ShellTestApiRequest request);
33
James Cook459354b32017-09-27 23:18:0134 MessageCenterController* message_center_controller();
[email protected]093b8d642014-04-03 20:59:2835 SystemGestureEventFilter* system_gesture_event_filter();
36 WorkspaceController* workspace_controller();
37 ScreenPositionController* screen_position_controller();
erg36cfb952017-06-21 19:41:4538 NativeCursorManagerAsh* native_cursor_manager_ash();
[email protected]093b8d642014-04-03 20:59:2839 DragDropController* drag_drop_controller();
Qiang Xu36234e532018-04-11 04:54:0240 PowerPrefs* power_prefs();
[email protected]945ece962013-03-21 06:42:3941
James Cookbbe5cb12017-08-08 18:32:2142 // Calls the private method.
43 void OnLocalStatePrefServiceInitialized(
44 std::unique_ptr<PrefService> pref_service);
45
Qiang Xu50c6f8c2017-08-31 20:55:2446 // Resets |shell_->power_button_controller_| to hold a new object to simulate
47 // Chrome starting.
48 void ResetPowerButtonControllerForTest();
49
James Cook7b7c6a52018-01-04 23:40:0350 // Simulates a modal dialog being open.
51 void SimulateModalWindowOpenForTest(bool modal_window_open);
52
James Cook00848f02018-01-05 18:02:5753 // mojom::ShellTestApi:
54 void IsSystemModalWindowOpen(IsSystemModalWindowOpenCallback cb) override;
Evan Staded689b332018-08-02 01:17:2255 void EnableTabletModeWindowManager(bool enable) override;
Noel Gordonfe3ac342018-09-10 05:12:5756 void EnableVirtualKeyboard(EnableVirtualKeyboardCallback cb) override;
James Cook00848f02018-01-05 18:02:5757
[email protected]0c68e892012-12-08 16:54:5358 private:
59 Shell* shell_; // not owned
60
61 DISALLOW_COPY_AND_ASSIGN(ShellTestApi);
62};
63
[email protected]0c68e892012-12-08 16:54:5364} // namespace ash
65
James Cook346c8c62017-07-18 19:38:3766#endif // ASH_SHELL_TEST_API_H_