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 "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 | 15 |
16 namespace keyboard { | 16 namespace keyboard { |
17 class KeyboardControllerProxy; | 17 class KeyboardControllerProxy; |
18 } | 18 } |
19 | 19 |
20 namespace ash { | 20 namespace ash { |
21 namespace test { | 21 namespace test { |
22 | 22 |
23 class TestSessionStateDelegate; | 23 class TestSessionStateDelegate; |
24 | 24 |
25 class TestShellDelegate : public ShellDelegate { | 25 class TestShellDelegate : public ShellDelegate { |
26 public: | 26 public: |
27 TestShellDelegate(); | 27 TestShellDelegate(); |
28 virtual ~TestShellDelegate(); | 28 ~TestShellDelegate() override; |
29 | 29 |
30 void set_multi_profiles_enabled(bool multi_profiles_enabled) { | 30 void set_multi_profiles_enabled(bool multi_profiles_enabled) { |
31 multi_profiles_enabled_ = multi_profiles_enabled; | 31 multi_profiles_enabled_ = multi_profiles_enabled; |
32 } | 32 } |
33 | 33 |
34 // Overridden from ShellDelegate: | 34 // Overridden from ShellDelegate: |
35 virtual bool IsFirstRunAfterBoot() const override; | 35 bool IsFirstRunAfterBoot() const override; |
36 virtual bool IsIncognitoAllowed() const override; | 36 bool IsIncognitoAllowed() const override; |
37 virtual bool IsMultiProfilesEnabled() const override; | 37 bool IsMultiProfilesEnabled() const override; |
38 virtual bool IsRunningInForcedAppMode() const override; | 38 bool IsRunningInForcedAppMode() const override; |
39 virtual bool IsMultiAccountEnabled() const override; | 39 bool IsMultiAccountEnabled() const override; |
40 virtual void PreInit() override; | 40 void PreInit() override; |
41 virtual void PreShutdown() override; | 41 void PreShutdown() override; |
42 virtual void Exit() override; | 42 void Exit() override; |
43 virtual keyboard::KeyboardControllerProxy* | 43 keyboard::KeyboardControllerProxy* CreateKeyboardControllerProxy() override; |
44 CreateKeyboardControllerProxy() override; | 44 void VirtualKeyboardActivated(bool activated) override; |
45 virtual void VirtualKeyboardActivated(bool activated) override; | 45 void AddVirtualKeyboardStateObserver( |
46 virtual void AddVirtualKeyboardStateObserver( | |
47 VirtualKeyboardStateObserver* observer) override; | 46 VirtualKeyboardStateObserver* observer) override; |
48 virtual void RemoveVirtualKeyboardStateObserver( | 47 void RemoveVirtualKeyboardStateObserver( |
49 VirtualKeyboardStateObserver* observer) override; | 48 VirtualKeyboardStateObserver* observer) override; |
50 virtual content::BrowserContext* GetActiveBrowserContext() override; | 49 content::BrowserContext* GetActiveBrowserContext() override; |
51 virtual app_list::AppListViewDelegate* GetAppListViewDelegate() override; | 50 app_list::AppListViewDelegate* GetAppListViewDelegate() override; |
52 virtual ShelfDelegate* CreateShelfDelegate(ShelfModel* model) override; | 51 ShelfDelegate* CreateShelfDelegate(ShelfModel* model) override; |
53 virtual SystemTrayDelegate* CreateSystemTrayDelegate() override; | 52 SystemTrayDelegate* CreateSystemTrayDelegate() override; |
54 virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() override; | 53 UserWallpaperDelegate* CreateUserWallpaperDelegate() override; |
55 virtual SessionStateDelegate* CreateSessionStateDelegate() override; | 54 SessionStateDelegate* CreateSessionStateDelegate() override; |
56 virtual AccessibilityDelegate* CreateAccessibilityDelegate() override; | 55 AccessibilityDelegate* CreateAccessibilityDelegate() override; |
57 virtual NewWindowDelegate* CreateNewWindowDelegate() override; | 56 NewWindowDelegate* CreateNewWindowDelegate() override; |
58 virtual MediaDelegate* CreateMediaDelegate() override; | 57 MediaDelegate* CreateMediaDelegate() override; |
59 virtual ui::MenuModel* CreateContextMenu( | 58 ui::MenuModel* CreateContextMenu(aura::Window* root, |
60 aura::Window* root, | 59 ash::ShelfItemDelegate* item_delegate, |
61 ash::ShelfItemDelegate* item_delegate, | 60 ash::ShelfItem* item) override; |
62 ash::ShelfItem* item) override; | 61 GPUSupport* CreateGPUSupport() override; |
63 virtual GPUSupport* CreateGPUSupport() override; | 62 base::string16 GetProductName() const override; |
64 virtual base::string16 GetProductName() const override; | |
65 | 63 |
66 int num_exit_requests() const { return num_exit_requests_; } | 64 int num_exit_requests() const { return num_exit_requests_; } |
67 | 65 |
68 TestSessionStateDelegate* test_session_state_delegate() { | 66 TestSessionStateDelegate* test_session_state_delegate() { |
69 return test_session_state_delegate_; | 67 return test_session_state_delegate_; |
70 } | 68 } |
71 | 69 |
72 void SetMediaCaptureState(MediaCaptureState state); | 70 void SetMediaCaptureState(MediaCaptureState state); |
73 | 71 |
74 private: | 72 private: |
75 int num_exit_requests_; | 73 int num_exit_requests_; |
76 bool multi_profiles_enabled_; | 74 bool multi_profiles_enabled_; |
77 | 75 |
78 scoped_ptr<content::BrowserContext> active_browser_context_; | 76 scoped_ptr<content::BrowserContext> active_browser_context_; |
79 scoped_ptr<app_list::AppListViewDelegate> app_list_view_delegate_; | 77 scoped_ptr<app_list::AppListViewDelegate> app_list_view_delegate_; |
80 | 78 |
81 ObserverList<ash::VirtualKeyboardStateObserver> keyboard_state_observer_list_; | 79 ObserverList<ash::VirtualKeyboardStateObserver> keyboard_state_observer_list_; |
82 | 80 |
83 TestSessionStateDelegate* test_session_state_delegate_; // Not owned. | 81 TestSessionStateDelegate* test_session_state_delegate_; // Not owned. |
84 | 82 |
85 DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); | 83 DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); |
86 }; | 84 }; |
87 | 85 |
88 } // namespace test | 86 } // namespace test |
89 } // namespace ash | 87 } // namespace ash |
90 | 88 |
91 #endif // ASH_TEST_TEST_SHELL_DELEGATE_H_ | 89 #endif // ASH_TEST_TEST_SHELL_DELEGATE_H_ |
OLD | NEW |