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> |
| 9 |
8 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
11 | 13 |
12 namespace ash { | 14 namespace ash { |
13 namespace test { | 15 namespace test { |
14 | 16 |
15 class AshTestBase; | 17 class AshTestBase; |
16 | 18 |
17 class TestShellDelegate : public ShellDelegate { | 19 class TestShellDelegate : public ShellDelegate { |
18 public: | 20 public: |
19 TestShellDelegate(); | 21 TestShellDelegate(); |
20 virtual ~TestShellDelegate(); | 22 virtual ~TestShellDelegate(); |
21 | 23 |
22 // Overridden from ShellDelegate: | 24 // Overridden from ShellDelegate: |
23 virtual bool IsUserLoggedIn() const OVERRIDE; | 25 virtual bool IsUserLoggedIn() const OVERRIDE; |
24 virtual bool IsSessionStarted() const OVERRIDE; | 26 virtual bool IsSessionStarted() const OVERRIDE; |
25 virtual bool IsFirstRunAfterBoot() const OVERRIDE; | 27 virtual bool IsFirstRunAfterBoot() const OVERRIDE; |
| 28 virtual bool IsRunningInForcedAppMode() const OVERRIDE; |
26 virtual bool CanLockScreen() const OVERRIDE; | 29 virtual bool CanLockScreen() const OVERRIDE; |
27 virtual void LockScreen() OVERRIDE; | 30 virtual void LockScreen() OVERRIDE; |
28 virtual void UnlockScreen() OVERRIDE; | 31 virtual void UnlockScreen() OVERRIDE; |
29 virtual bool IsScreenLocked() const OVERRIDE; | 32 virtual bool IsScreenLocked() const OVERRIDE; |
30 virtual void Shutdown() OVERRIDE; | 33 virtual void Shutdown() OVERRIDE; |
31 virtual void Exit() OVERRIDE; | 34 virtual void Exit() OVERRIDE; |
32 virtual void NewTab() OVERRIDE; | 35 virtual void NewTab() OVERRIDE; |
33 virtual void NewWindow(bool incognito) OVERRIDE; | 36 virtual void NewWindow(bool incognito) OVERRIDE; |
34 virtual void ToggleMaximized() OVERRIDE; | 37 virtual void ToggleMaximized() OVERRIDE; |
35 virtual void OpenFileManager(bool as_dialog) OVERRIDE; | 38 virtual void OpenFileManager(bool as_dialog) OVERRIDE; |
(...skipping 28 matching lines...) Expand all Loading... |
64 virtual void HandleMediaPrevTrack() OVERRIDE; | 67 virtual void HandleMediaPrevTrack() OVERRIDE; |
65 virtual string16 GetTimeRemainingString(base::TimeDelta delta) OVERRIDE; | 68 virtual string16 GetTimeRemainingString(base::TimeDelta delta) OVERRIDE; |
66 virtual string16 GetTimeDurationLongString(base::TimeDelta delta) OVERRIDE; | 69 virtual string16 GetTimeDurationLongString(base::TimeDelta delta) OVERRIDE; |
67 virtual void SaveScreenMagnifierScale(double scale) OVERRIDE; | 70 virtual void SaveScreenMagnifierScale(double scale) OVERRIDE; |
68 virtual double GetSavedScreenMagnifierScale() OVERRIDE; | 71 virtual double GetSavedScreenMagnifierScale() OVERRIDE; |
69 virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root) OVERRIDE; | 72 virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root) OVERRIDE; |
70 virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE; | 73 virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE; |
71 virtual string16 GetProductName() const OVERRIDE; | 74 virtual string16 GetProductName() const OVERRIDE; |
72 | 75 |
73 int num_exit_requests() const { return num_exit_requests_; } | 76 int num_exit_requests() const { return num_exit_requests_; } |
| 77 |
74 private: | 78 private: |
75 friend class ash::test::AshTestBase; | 79 friend class ash::test::AshTestBase; |
76 | 80 |
77 // Given |session_started| will update internal state. | 81 // Given |session_started| will update internal state. |
78 // If |session_started| is true this method will also set | 82 // If |session_started| is true this method will also set |
79 // |user_logged_in_| to true. | 83 // |user_logged_in_| to true. |
80 // When session is started it always means that user has logged in. | 84 // When session is started it always means that user has logged in. |
81 // Possible situation is that user has already logged in but session has not | 85 // Possible situation is that user has already logged in but session has not |
82 // been started (user selects avatar and login window is still open). | 86 // been started (user selects avatar and login window is still open). |
83 void SetSessionStarted(bool session_started); | 87 void SetSessionStarted(bool session_started); |
(...skipping 20 matching lines...) Expand all Loading... |
104 | 108 |
105 scoped_ptr<content::BrowserContext> current_browser_context_; | 109 scoped_ptr<content::BrowserContext> current_browser_context_; |
106 | 110 |
107 DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); | 111 DISALLOW_COPY_AND_ASSIGN(TestShellDelegate); |
108 }; | 112 }; |
109 | 113 |
110 } // namespace test | 114 } // namespace test |
111 } // namespace ash | 115 } // namespace ash |
112 | 116 |
113 #endif // ASH_TEST_TEST_SHELL_DELEGATE_H_ | 117 #endif // ASH_TEST_TEST_SHELL_DELEGATE_H_ |
OLD | NEW |