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 <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/media_delegate.h" | 10 #include "ash/media_delegate.h" |
11 #include "ash/shell_delegate.h" | 11 #include "ash/shell_delegate.h" |
12 #include "ash/test/test_session_state_delegate.h" | 12 #include "ash/test/test_session_state_delegate.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 | 17 |
| 18 namespace app_list { |
| 19 class AppListShowerDelegateFactory; |
| 20 class AppListShowerImpl; |
| 21 } |
| 22 |
18 namespace keyboard { | 23 namespace keyboard { |
19 class KeyboardUI; | 24 class KeyboardUI; |
20 } | 25 } |
21 | 26 |
22 namespace ash { | 27 namespace ash { |
23 namespace test { | 28 namespace test { |
24 | 29 |
25 class TestShellDelegate : public ShellDelegate { | 30 class TestShellDelegate : public ShellDelegate { |
26 public: | 31 public: |
27 TestShellDelegate(); | 32 TestShellDelegate(); |
28 ~TestShellDelegate() override; | 33 ~TestShellDelegate() override; |
29 | 34 |
30 void set_multi_profiles_enabled(bool multi_profiles_enabled) { | 35 void set_multi_profiles_enabled(bool multi_profiles_enabled) { |
31 multi_profiles_enabled_ = multi_profiles_enabled; | 36 multi_profiles_enabled_ = multi_profiles_enabled; |
32 } | 37 } |
33 | 38 |
| 39 app_list::AppListShowerImpl* app_list_shower() { |
| 40 return app_list_shower_.get(); |
| 41 } |
| 42 |
34 // Overridden from ShellDelegate: | 43 // Overridden from ShellDelegate: |
35 bool IsFirstRunAfterBoot() const override; | 44 bool IsFirstRunAfterBoot() const override; |
36 bool IsIncognitoAllowed() const override; | 45 bool IsIncognitoAllowed() const override; |
37 bool IsMultiProfilesEnabled() const override; | 46 bool IsMultiProfilesEnabled() const override; |
38 bool IsRunningInForcedAppMode() const override; | 47 bool IsRunningInForcedAppMode() const override; |
39 bool CanShowWindowForUser(aura::Window* window) const override; | 48 bool CanShowWindowForUser(aura::Window* window) const override; |
40 bool IsForceMaximizeOnFirstRun() const override; | 49 bool IsForceMaximizeOnFirstRun() const override; |
41 void PreInit() override; | 50 void PreInit() override; |
42 void PreShutdown() override; | 51 void PreShutdown() override; |
43 void Exit() override; | 52 void Exit() override; |
44 keyboard::KeyboardUI* CreateKeyboardUI() override; | 53 keyboard::KeyboardUI* CreateKeyboardUI() override; |
45 void VirtualKeyboardActivated(bool activated) override; | 54 void VirtualKeyboardActivated(bool activated) override; |
46 void AddVirtualKeyboardStateObserver( | 55 void AddVirtualKeyboardStateObserver( |
47 VirtualKeyboardStateObserver* observer) override; | 56 VirtualKeyboardStateObserver* observer) override; |
48 void RemoveVirtualKeyboardStateObserver( | 57 void RemoveVirtualKeyboardStateObserver( |
49 VirtualKeyboardStateObserver* observer) override; | 58 VirtualKeyboardStateObserver* observer) override; |
50 void OpenUrl(const GURL& url) override; | 59 void OpenUrl(const GURL& url) override; |
51 app_list::AppListViewDelegate* GetAppListViewDelegate() override; | 60 app_list::AppListShower* GetAppListShower() override; |
52 ShelfDelegate* CreateShelfDelegate(ShelfModel* model) override; | 61 ShelfDelegate* CreateShelfDelegate(ShelfModel* model) override; |
53 SystemTrayDelegate* CreateSystemTrayDelegate() override; | 62 SystemTrayDelegate* CreateSystemTrayDelegate() override; |
54 UserWallpaperDelegate* CreateUserWallpaperDelegate() override; | 63 UserWallpaperDelegate* CreateUserWallpaperDelegate() override; |
55 TestSessionStateDelegate* CreateSessionStateDelegate() override; | 64 TestSessionStateDelegate* CreateSessionStateDelegate() override; |
56 AccessibilityDelegate* CreateAccessibilityDelegate() override; | 65 AccessibilityDelegate* CreateAccessibilityDelegate() override; |
57 NewWindowDelegate* CreateNewWindowDelegate() override; | 66 NewWindowDelegate* CreateNewWindowDelegate() override; |
58 MediaDelegate* CreateMediaDelegate() override; | 67 MediaDelegate* CreateMediaDelegate() override; |
59 ui::MenuModel* CreateContextMenu(ash::Shelf* shelf, | 68 ui::MenuModel* CreateContextMenu(ash::Shelf* shelf, |
60 const ash::ShelfItem* item) override; | 69 const ash::ShelfItem* item) override; |
61 GPUSupport* CreateGPUSupport() override; | 70 GPUSupport* CreateGPUSupport() override; |
62 base::string16 GetProductName() const override; | 71 base::string16 GetProductName() const override; |
63 gfx::Image GetDeprecatedAcceleratorImage() const override; | 72 gfx::Image GetDeprecatedAcceleratorImage() const override; |
64 | 73 |
65 int num_exit_requests() const { return num_exit_requests_; } | 74 int num_exit_requests() const { return num_exit_requests_; } |
66 | 75 |
67 void SetMediaCaptureState(MediaCaptureState state); | 76 void SetMediaCaptureState(MediaCaptureState state); |
68 void SetForceMaximizeOnFirstRun(bool maximize) { | 77 void SetForceMaximizeOnFirstRun(bool maximize) { |
69 force_maximize_on_first_run_ = maximize; | 78 force_maximize_on_first_run_ = maximize; |
70 } | 79 } |
71 | 80 |
72 private: | 81 private: |
73 int num_exit_requests_; | 82 int num_exit_requests_; |
74 bool multi_profiles_enabled_; | 83 bool multi_profiles_enabled_; |
75 bool force_maximize_on_first_run_; | 84 bool force_maximize_on_first_run_; |
76 | 85 |
77 scoped_ptr<app_list::AppListViewDelegate> app_list_view_delegate_; | 86 scoped_ptr<app_list::AppListShowerDelegateFactory> |
| 87 app_list_shower_delegate_factory_; |
| 88 scoped_ptr<app_list::AppListShowerImpl> app_list_shower_; |
78 | 89 |
79 base::ObserverList<ash::VirtualKeyboardStateObserver> | 90 base::ObserverList<ash::VirtualKeyboardStateObserver> |
80 keyboard_state_observer_list_; | 91 keyboard_state_observer_list_; |
81 | 92 |
82 DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); | 93 DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); |
83 }; | 94 }; |
84 | 95 |
85 } // namespace test | 96 } // namespace test |
86 } // namespace ash | 97 } // namespace ash |
87 | 98 |
88 #endif // ASH_TEST_TEST_SHELL_DELEGATE_H_ | 99 #endif // ASH_TEST_TEST_SHELL_DELEGATE_H_ |
OLD | NEW |