blob: 5dcb2c2233d15300e1ff60c4f674ee795f002725 [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;
[email protected]0c68e892012-12-08 16:54:5319class ScreenPositionController;
[email protected]093b8d642014-04-03 20:59:2820class Shell;
[email protected]0c68e892012-12-08 16:54:5321class SystemGestureEventFilter;
22class WorkspaceController;
[email protected]0c68e892012-12-08 16:54:5323
[email protected]0c68e892012-12-08 16:54:5324// Accesses private data from a Shell for testing.
James Cook00848f02018-01-05 18:02:5725class ShellTestApi : public mojom::ShellTestApi {
jamescookb8dcef522016-06-25 14:42:5526 public:
sky07a24d42017-03-09 23:57:3027 ShellTestApi();
[email protected]0c68e892012-12-08 16:54:5328 explicit ShellTestApi(Shell* shell);
29
James Cook00848f02018-01-05 18:02:5730 // Creates and binds an instance from a remote request (e.g. from chrome).
31 static void BindRequest(mojom::ShellTestApiRequest request);
32
James Cook459354b32017-09-27 23:18:0133 MessageCenterController* message_center_controller();
[email protected]093b8d642014-04-03 20:59:2834 SystemGestureEventFilter* system_gesture_event_filter();
35 WorkspaceController* workspace_controller();
36 ScreenPositionController* screen_position_controller();
erg36cfb952017-06-21 19:41:4537 NativeCursorManagerAsh* native_cursor_manager_ash();
[email protected]093b8d642014-04-03 20:59:2838 DragDropController* drag_drop_controller();
[email protected]945ece962013-03-21 06:42:3939
James Cookbbe5cb12017-08-08 18:32:2140 // Calls the private method.
41 void OnLocalStatePrefServiceInitialized(
42 std::unique_ptr<PrefService> pref_service);
43
Qiang Xu50c6f8c2017-08-31 20:55:2444 // Resets |shell_->power_button_controller_| to hold a new object to simulate
45 // Chrome starting.
46 void ResetPowerButtonControllerForTest();
47
James Cook7b7c6a52018-01-04 23:40:0348 // Simulates a modal dialog being open.
49 void SimulateModalWindowOpenForTest(bool modal_window_open);
50
James Cook00848f02018-01-05 18:02:5751 // mojom::ShellTestApi:
52 void IsSystemModalWindowOpen(IsSystemModalWindowOpenCallback cb) override;
53
[email protected]0c68e892012-12-08 16:54:5354 private:
55 Shell* shell_; // not owned
56
57 DISALLOW_COPY_AND_ASSIGN(ShellTestApi);
58};
59
[email protected]0c68e892012-12-08 16:54:5360} // namespace ash
61
James Cook346c8c62017-07-18 19:38:3762#endif // ASH_SHELL_TEST_API_H_