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 #include "ash/shell/shell_delegate_impl.h" | 5 #include "ash/shell/shell_delegate_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "ash/caps_lock_delegate_stub.h" | 9 #include "ash/caps_lock_delegate_stub.h" |
10 #include "ash/host/root_window_host_factory.h" | 10 #include "ash/host/root_window_host_factory.h" |
11 #include "ash/session_state_delegate.h" | |
12 #include "ash/session_state_delegate_stub.h" | |
13 #include "ash/shell/context_menu.h" | 11 #include "ash/shell/context_menu.h" |
14 #include "ash/shell/example_factory.h" | 12 #include "ash/shell/example_factory.h" |
15 #include "ash/shell/launcher_delegate_impl.h" | 13 #include "ash/shell/launcher_delegate_impl.h" |
16 #include "ash/shell/toplevel_window.h" | 14 #include "ash/shell/toplevel_window.h" |
17 #include "ash/shell_window_ids.h" | 15 #include "ash/shell_window_ids.h" |
18 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
19 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
20 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
21 | 19 |
22 namespace ash { | 20 namespace ash { |
23 namespace shell { | 21 namespace shell { |
24 | 22 |
25 ShellDelegateImpl::ShellDelegateImpl() | 23 ShellDelegateImpl::ShellDelegateImpl() |
26 : watcher_(NULL), | 24 : watcher_(NULL), |
27 launcher_delegate_(NULL), | 25 launcher_delegate_(NULL), |
| 26 locked_(false), |
28 spoken_feedback_enabled_(false), | 27 spoken_feedback_enabled_(false), |
29 high_contrast_enabled_(false), | 28 high_contrast_enabled_(false), |
30 screen_magnifier_enabled_(false), | 29 screen_magnifier_enabled_(false), |
31 screen_magnifier_type_(kDefaultMagnifierType) { | 30 screen_magnifier_type_(kDefaultMagnifierType) { |
32 } | 31 } |
33 | 32 |
34 ShellDelegateImpl::~ShellDelegateImpl() { | 33 ShellDelegateImpl::~ShellDelegateImpl() { |
35 } | 34 } |
36 | 35 |
37 void ShellDelegateImpl::SetWatcher(WindowWatcher* watcher) { | 36 void ShellDelegateImpl::SetWatcher(WindowWatcher* watcher) { |
38 watcher_ = watcher; | 37 watcher_ = watcher; |
39 if (launcher_delegate_) | 38 if (launcher_delegate_) |
40 launcher_delegate_->set_watcher(watcher); | 39 launcher_delegate_->set_watcher(watcher); |
41 } | 40 } |
42 | 41 |
| 42 bool ShellDelegateImpl::IsUserLoggedIn() const { |
| 43 return true; |
| 44 } |
| 45 |
| 46 bool ShellDelegateImpl::IsSessionStarted() const { |
| 47 return true; |
| 48 } |
| 49 |
| 50 bool ShellDelegateImpl::IsGuestSession() const { |
| 51 return false; |
| 52 } |
| 53 |
43 bool ShellDelegateImpl::IsFirstRunAfterBoot() const { | 54 bool ShellDelegateImpl::IsFirstRunAfterBoot() const { |
44 return false; | 55 return false; |
45 } | 56 } |
46 | 57 |
47 bool ShellDelegateImpl::IsMultiProfilesEnabled() const { | 58 bool ShellDelegateImpl::IsMultiProfilesEnabled() const { |
48 return false; | 59 return false; |
49 } | 60 } |
50 | 61 |
51 bool ShellDelegateImpl::IsRunningInForcedAppMode() const { | 62 bool ShellDelegateImpl::IsRunningInForcedAppMode() const { |
52 return false; | 63 return false; |
53 } | 64 } |
54 | 65 |
| 66 bool ShellDelegateImpl::CanLockScreen() const { |
| 67 return true; |
| 68 } |
| 69 |
| 70 void ShellDelegateImpl::LockScreen() { |
| 71 ash::shell::CreateLockScreen(); |
| 72 locked_ = true; |
| 73 ash::Shell::GetInstance()->UpdateShelfVisibility(); |
| 74 } |
| 75 |
| 76 void ShellDelegateImpl::UnlockScreen() { |
| 77 locked_ = false; |
| 78 ash::Shell::GetInstance()->UpdateShelfVisibility(); |
| 79 } |
| 80 |
| 81 bool ShellDelegateImpl::IsScreenLocked() const { |
| 82 return locked_; |
| 83 } |
| 84 |
55 void ShellDelegateImpl::PreInit() { | 85 void ShellDelegateImpl::PreInit() { |
56 } | 86 } |
57 | 87 |
58 void ShellDelegateImpl::Shutdown() { | 88 void ShellDelegateImpl::Shutdown() { |
59 } | 89 } |
60 | 90 |
61 void ShellDelegateImpl::Exit() { | 91 void ShellDelegateImpl::Exit() { |
62 MessageLoopForUI::current()->Quit(); | 92 MessageLoopForUI::current()->Quit(); |
63 } | 93 } |
64 | 94 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 191 } |
162 | 192 |
163 ash::UserWallpaperDelegate* ShellDelegateImpl::CreateUserWallpaperDelegate() { | 193 ash::UserWallpaperDelegate* ShellDelegateImpl::CreateUserWallpaperDelegate() { |
164 return NULL; | 194 return NULL; |
165 } | 195 } |
166 | 196 |
167 ash::CapsLockDelegate* ShellDelegateImpl::CreateCapsLockDelegate() { | 197 ash::CapsLockDelegate* ShellDelegateImpl::CreateCapsLockDelegate() { |
168 return new CapsLockDelegateStub; | 198 return new CapsLockDelegateStub; |
169 } | 199 } |
170 | 200 |
171 ash::SessionStateDelegate* ShellDelegateImpl::CreateSessionStateDelegate() { | |
172 return new SessionStateDelegateStub; | |
173 } | |
174 | |
175 aura::client::UserActionClient* ShellDelegateImpl::CreateUserActionClient() { | 201 aura::client::UserActionClient* ShellDelegateImpl::CreateUserActionClient() { |
176 return NULL; | 202 return NULL; |
177 } | 203 } |
178 | 204 |
179 void ShellDelegateImpl::OpenFeedbackPage() { | 205 void ShellDelegateImpl::OpenFeedbackPage() { |
180 } | 206 } |
181 | 207 |
182 void ShellDelegateImpl::RecordUserMetricsAction(UserMetricsAction action) { | 208 void ShellDelegateImpl::RecordUserMetricsAction(UserMetricsAction action) { |
183 } | 209 } |
184 | 210 |
(...skipping 30 matching lines...) Expand all Loading... |
215 RootWindowHostFactory* ShellDelegateImpl::CreateRootWindowHostFactory() { | 241 RootWindowHostFactory* ShellDelegateImpl::CreateRootWindowHostFactory() { |
216 return RootWindowHostFactory::Create(); | 242 return RootWindowHostFactory::Create(); |
217 } | 243 } |
218 | 244 |
219 base::string16 ShellDelegateImpl::GetProductName() const { | 245 base::string16 ShellDelegateImpl::GetProductName() const { |
220 return base::string16(); | 246 return base::string16(); |
221 } | 247 } |
222 | 248 |
223 } // namespace shell | 249 } // namespace shell |
224 } // namespace ash | 250 } // namespace ash |
OLD | NEW |