OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_TEST_TEST_SHELL_DELEGATE_H_ | 5 #ifndef ASH_TEST_TEST_SHELL_DELEGATE_H_ |
6 #define ASH_TEST_TEST_SHELL_DELEGATE_H_ | 6 #define ASH_TEST_TEST_SHELL_DELEGATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "ash/common/shell_delegate.h" | 11 #include "ash/common/shell_delegate.h" |
12 #include "ash/common/test/test_session_state_delegate.h" | 12 #include "ash/common/test/test_session_state_delegate.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 | 14 |
15 namespace app_list { | |
16 class AppListPresenterDelegateFactory; | |
17 class AppListPresenterImpl; | |
18 } | |
19 | |
20 namespace keyboard { | 15 namespace keyboard { |
21 class KeyboardUI; | 16 class KeyboardUI; |
22 } | 17 } |
23 | 18 |
24 namespace ash { | 19 namespace ash { |
25 namespace test { | 20 namespace test { |
26 | 21 |
27 class TestShellDelegate : public ShellDelegate { | 22 class TestShellDelegate : public ShellDelegate { |
28 public: | 23 public: |
29 TestShellDelegate(); | 24 TestShellDelegate(); |
30 ~TestShellDelegate() override; | 25 ~TestShellDelegate() override; |
31 | 26 |
32 void set_multi_profiles_enabled(bool multi_profiles_enabled) { | 27 void set_multi_profiles_enabled(bool multi_profiles_enabled) { |
33 multi_profiles_enabled_ = multi_profiles_enabled; | 28 multi_profiles_enabled_ = multi_profiles_enabled; |
34 } | 29 } |
35 | 30 |
36 // Overridden from ShellDelegate: | 31 // Overridden from ShellDelegate: |
37 ::service_manager::Connector* GetShellConnector() const override; | 32 ::service_manager::Connector* GetShellConnector() const override; |
38 bool IsIncognitoAllowed() const override; | 33 bool IsIncognitoAllowed() const override; |
39 bool IsMultiProfilesEnabled() const override; | 34 bool IsMultiProfilesEnabled() const override; |
40 bool IsRunningInForcedAppMode() const override; | 35 bool IsRunningInForcedAppMode() const override; |
41 bool CanShowWindowForUser(WmWindow* window) const override; | 36 bool CanShowWindowForUser(WmWindow* window) const override; |
42 bool IsForceMaximizeOnFirstRun() const override; | 37 bool IsForceMaximizeOnFirstRun() const override; |
43 void PreInit() override; | 38 void PreInit() override; |
44 void PreShutdown() override; | 39 void PreShutdown() override; |
45 void Exit() override; | 40 void Exit() override; |
46 keyboard::KeyboardUI* CreateKeyboardUI() override; | 41 keyboard::KeyboardUI* CreateKeyboardUI() override; |
47 void OpenUrlFromArc(const GURL& url) override; | 42 void OpenUrlFromArc(const GURL& url) override; |
48 app_list::AppListPresenter* GetAppListPresenter() override; | |
49 ShelfDelegate* CreateShelfDelegate(ShelfModel* model) override; | 43 ShelfDelegate* CreateShelfDelegate(ShelfModel* model) override; |
50 SystemTrayDelegate* CreateSystemTrayDelegate() override; | 44 SystemTrayDelegate* CreateSystemTrayDelegate() override; |
51 std::unique_ptr<WallpaperDelegate> CreateWallpaperDelegate() override; | 45 std::unique_ptr<WallpaperDelegate> CreateWallpaperDelegate() override; |
52 TestSessionStateDelegate* CreateSessionStateDelegate() override; | 46 TestSessionStateDelegate* CreateSessionStateDelegate() override; |
53 AccessibilityDelegate* CreateAccessibilityDelegate() override; | 47 AccessibilityDelegate* CreateAccessibilityDelegate() override; |
54 std::unique_ptr<PaletteDelegate> CreatePaletteDelegate() override; | 48 std::unique_ptr<PaletteDelegate> CreatePaletteDelegate() override; |
55 ui::MenuModel* CreateContextMenu(WmShelf* wm_shelf, | 49 ui::MenuModel* CreateContextMenu(WmShelf* wm_shelf, |
56 const ShelfItem* item) override; | 50 const ShelfItem* item) override; |
57 GPUSupport* CreateGPUSupport() override; | 51 GPUSupport* CreateGPUSupport() override; |
58 base::string16 GetProductName() const override; | 52 base::string16 GetProductName() const override; |
59 gfx::Image GetDeprecatedAcceleratorImage() const override; | 53 gfx::Image GetDeprecatedAcceleratorImage() const override; |
60 | 54 |
61 bool IsTouchscreenEnabledInPrefs(bool use_local_state) const override; | 55 bool IsTouchscreenEnabledInPrefs(bool use_local_state) const override; |
62 void SetTouchscreenEnabledInPrefs(bool enabled, | 56 void SetTouchscreenEnabledInPrefs(bool enabled, |
63 bool use_local_state) override; | 57 bool use_local_state) override; |
64 void UpdateTouchscreenStatusFromPrefs() override; | 58 void UpdateTouchscreenStatusFromPrefs() override; |
65 | 59 |
66 int num_exit_requests() const { return num_exit_requests_; } | 60 int num_exit_requests() const { return num_exit_requests_; } |
67 | 61 |
68 app_list::AppListPresenterImpl* app_list_presenter() { | |
69 return app_list_presenter_.get(); | |
70 } | |
71 | |
72 void SetForceMaximizeOnFirstRun(bool maximize) { | 62 void SetForceMaximizeOnFirstRun(bool maximize) { |
73 force_maximize_on_first_run_ = maximize; | 63 force_maximize_on_first_run_ = maximize; |
74 } | 64 } |
75 | 65 |
76 private: | 66 private: |
77 int num_exit_requests_; | 67 int num_exit_requests_; |
78 bool multi_profiles_enabled_; | 68 bool multi_profiles_enabled_; |
79 bool force_maximize_on_first_run_; | 69 bool force_maximize_on_first_run_; |
80 bool touchscreen_enabled_in_local_pref_; | 70 bool touchscreen_enabled_in_local_pref_; |
81 | 71 |
82 std::unique_ptr<app_list::AppListPresenterDelegateFactory> | |
83 app_list_presenter_delegate_factory_; | |
84 std::unique_ptr<app_list::AppListPresenterImpl> app_list_presenter_; | |
85 | |
86 DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); | 72 DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); |
87 }; | 73 }; |
88 | 74 |
89 } // namespace test | 75 } // namespace test |
90 } // namespace ash | 76 } // namespace ash |
91 | 77 |
92 #endif // ASH_TEST_TEST_SHELL_DELEGATE_H_ | 78 #endif // ASH_TEST_TEST_SHELL_DELEGATE_H_ |
OLD | NEW |