OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_SHELL_SHELL_DELEGATE_IMPL_H_ | 5 #ifndef WM_TEST_TEST_SHELL_DELEGATE_H_ |
6 #define ASH_SHELL_SHELL_DELEGATE_IMPL_H_ | 6 #define WM_TEST_TEST_SHELL_DELEGATE_H_ |
7 | 7 |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" |
10 | 11 |
11 namespace ash { | 12 namespace wm { |
12 namespace shell { | 13 namespace test { |
13 | 14 |
14 class LauncherDelegateImpl; | 15 class TestShellDelegate : public ash::ShellDelegate { |
15 class WindowWatcher; | 16 public: |
| 17 TestShellDelegate(); |
| 18 virtual ~TestShellDelegate(); |
16 | 19 |
17 class ShellDelegateImpl : public ash::ShellDelegate { | 20 // Overridden from ShellDelegate: |
18 public: | |
19 ShellDelegateImpl(); | |
20 virtual ~ShellDelegateImpl(); | |
21 | |
22 void SetWatcher(WindowWatcher* watcher); | |
23 | |
24 virtual bool IsUserLoggedIn() const OVERRIDE; | 21 virtual bool IsUserLoggedIn() const OVERRIDE; |
25 virtual bool IsSessionStarted() const OVERRIDE; | 22 virtual bool IsSessionStarted() const OVERRIDE; |
26 virtual bool IsFirstRunAfterBoot() const OVERRIDE; | 23 virtual bool IsFirstRunAfterBoot() const OVERRIDE; |
27 virtual bool CanLockScreen() const OVERRIDE; | 24 virtual bool CanLockScreen() const OVERRIDE; |
28 virtual void LockScreen() OVERRIDE; | 25 virtual void LockScreen() OVERRIDE; |
29 virtual void UnlockScreen() OVERRIDE; | 26 virtual void UnlockScreen() OVERRIDE; |
30 virtual bool IsScreenLocked() const OVERRIDE; | 27 virtual bool IsScreenLocked() const OVERRIDE; |
31 virtual void Shutdown() OVERRIDE; | 28 virtual void Shutdown() OVERRIDE; |
32 virtual void Exit() OVERRIDE; | 29 virtual void Exit() OVERRIDE; |
33 virtual void NewTab() OVERRIDE; | 30 virtual void NewTab() OVERRIDE; |
34 virtual void NewWindow(bool incognito) OVERRIDE; | 31 virtual void NewWindow(bool incognito) OVERRIDE; |
35 virtual void ToggleMaximized() OVERRIDE; | 32 virtual void ToggleMaximized() OVERRIDE; |
36 virtual void OpenFileManager() OVERRIDE; | 33 virtual void OpenFileManager() OVERRIDE; |
37 virtual void OpenCrosh() OVERRIDE; | 34 virtual void OpenCrosh() OVERRIDE; |
38 virtual void OpenMobileSetup(const std::string& service_path) OVERRIDE; | 35 virtual void OpenMobileSetup(const std::string& service_path) OVERRIDE; |
39 virtual void RestoreTab() OVERRIDE; | 36 virtual void RestoreTab() OVERRIDE; |
40 virtual bool RotatePaneFocus(Shell::Direction direction) OVERRIDE; | 37 virtual bool RotatePaneFocus(ash::Shell::Direction direction) OVERRIDE; |
41 virtual void ShowKeyboardOverlay() OVERRIDE; | 38 virtual void ShowKeyboardOverlay() OVERRIDE; |
42 virtual void ShowTaskManager() OVERRIDE; | 39 virtual void ShowTaskManager() OVERRIDE; |
43 virtual content::BrowserContext* GetCurrentBrowserContext() OVERRIDE; | 40 virtual content::BrowserContext* GetCurrentBrowserContext() OVERRIDE; |
44 virtual void ToggleSpokenFeedback( | 41 virtual void ToggleSpokenFeedback( |
45 AccessibilityNotificationVisibility notify) OVERRIDE; | 42 ash::AccessibilityNotificationVisibility notify) OVERRIDE; |
46 virtual bool IsSpokenFeedbackEnabled() const OVERRIDE; | 43 virtual bool IsSpokenFeedbackEnabled() const OVERRIDE; |
47 virtual void ToggleHighContrast() OVERRIDE; | 44 virtual void ToggleHighContrast() OVERRIDE; |
48 virtual bool IsHighContrastEnabled() const OVERRIDE; | 45 virtual bool IsHighContrastEnabled() const OVERRIDE; |
49 virtual void SetMagnifierEnabled(bool enabled) OVERRIDE; | 46 virtual void SetMagnifierEnabled(bool enabled) OVERRIDE; |
50 virtual void SetMagnifierType(MagnifierType type) OVERRIDE; | 47 virtual void SetMagnifierType(ash::MagnifierType type) OVERRIDE; |
51 virtual bool IsMagnifierEnabled() const OVERRIDE; | 48 virtual bool IsMagnifierEnabled() const OVERRIDE; |
52 virtual MagnifierType GetMagnifierType() const OVERRIDE; | 49 virtual ash::MagnifierType GetMagnifierType() const OVERRIDE; |
53 virtual bool ShouldAlwaysShowAccessibilityMenu() const OVERRIDE; | 50 virtual bool ShouldAlwaysShowAccessibilityMenu() const OVERRIDE; |
54 virtual app_list::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE; | 51 virtual app_list::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE; |
55 virtual ash::LauncherDelegate* CreateLauncherDelegate( | 52 virtual ash::LauncherDelegate* CreateLauncherDelegate( |
56 ash::LauncherModel* model) OVERRIDE; | 53 ash::LauncherModel* model) OVERRIDE; |
57 virtual ash::SystemTrayDelegate* CreateSystemTrayDelegate() OVERRIDE; | 54 virtual ash::SystemTrayDelegate* CreateSystemTrayDelegate() OVERRIDE; |
58 virtual ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE; | 55 virtual ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE; |
59 virtual ash::CapsLockDelegate* CreateCapsLockDelegate() OVERRIDE; | 56 virtual ash::CapsLockDelegate* CreateCapsLockDelegate() OVERRIDE; |
60 virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; | 57 virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE; |
61 virtual void OpenFeedbackPage() OVERRIDE; | 58 virtual void OpenFeedbackPage() OVERRIDE; |
62 virtual void RecordUserMetricsAction(UserMetricsAction action) OVERRIDE; | 59 virtual void RecordUserMetricsAction(ash::UserMetricsAction action) OVERRIDE; |
63 virtual void HandleMediaNextTrack() OVERRIDE; | 60 virtual void HandleMediaNextTrack() OVERRIDE; |
64 virtual void HandleMediaPlayPause() OVERRIDE; | 61 virtual void HandleMediaPlayPause() OVERRIDE; |
65 virtual void HandleMediaPrevTrack() OVERRIDE; | 62 virtual void HandleMediaPrevTrack() OVERRIDE; |
66 virtual string16 GetTimeRemainingString(base::TimeDelta delta) OVERRIDE; | 63 virtual string16 GetTimeRemainingString(base::TimeDelta delta) OVERRIDE; |
67 virtual string16 GetTimeDurationLongString(base::TimeDelta delta) OVERRIDE; | 64 virtual string16 GetTimeDurationLongString(base::TimeDelta delta) OVERRIDE; |
68 virtual void SaveScreenMagnifierScale(double scale) OVERRIDE; | 65 virtual void SaveScreenMagnifierScale(double scale) OVERRIDE; |
69 virtual double GetSavedScreenMagnifierScale() OVERRIDE; | 66 virtual double GetSavedScreenMagnifierScale() OVERRIDE; |
70 virtual ui::MenuModel* CreateContextMenu( | 67 virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root) OVERRIDE; |
71 aura::RootWindow* root_window) OVERRIDE; | 68 virtual ash::RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE; |
72 virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE; | |
73 virtual string16 GetProductName() const OVERRIDE; | 69 virtual string16 GetProductName() const OVERRIDE; |
74 | 70 |
75 private: | 71 private: |
76 // Used to update Launcher. Owned by main. | 72 bool screen_magnifier_enabled_; |
77 WindowWatcher* watcher_; | 73 ash::MagnifierType screen_magnifier_type_; |
78 | 74 |
79 LauncherDelegateImpl* launcher_delegate_; | 75 scoped_ptr<content::BrowserContext> current_browser_context_; |
80 | 76 |
81 bool locked_; | 77 DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); |
82 bool spoken_feedback_enabled_; | |
83 bool high_contrast_enabled_; | |
84 bool screen_magnifier_enabled_; | |
85 MagnifierType screen_magnifier_type_; | |
86 | |
87 DISALLOW_COPY_AND_ASSIGN(ShellDelegateImpl); | |
88 }; | 78 }; |
89 | 79 |
90 } // namespace shell | 80 } // namespace test |
91 } // namespace ash | 81 } // namespace wm |
92 | 82 |
93 #endif // ASH_SHELL_SHELL_DELEGATE_IMPL_H_ | 83 #endif // WM_TEST_TEST_SHELL_DELEGATE_H_ |
OLD | NEW |