Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Side by Side Diff: ash/shell/shell_delegate_impl.cc

Issue 14295008: Add ash SessionStateDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shell/shell_delegate_impl.h ('k') | ash/shell/window_type_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "ash/shell/context_menu.h" 13 #include "ash/shell/context_menu.h"
12 #include "ash/shell/example_factory.h" 14 #include "ash/shell/example_factory.h"
13 #include "ash/shell/launcher_delegate_impl.h" 15 #include "ash/shell/launcher_delegate_impl.h"
14 #include "ash/shell/toplevel_window.h" 16 #include "ash/shell/toplevel_window.h"
15 #include "ash/shell_window_ids.h" 17 #include "ash/shell_window_ids.h"
16 #include "ash/wm/window_util.h" 18 #include "ash/wm/window_util.h"
17 #include "base/message_loop.h" 19 #include "base/message_loop.h"
18 #include "ui/aura/window.h" 20 #include "ui/aura/window.h"
19 21
20 namespace ash { 22 namespace ash {
21 namespace shell { 23 namespace shell {
22 24
23 ShellDelegateImpl::ShellDelegateImpl() 25 ShellDelegateImpl::ShellDelegateImpl()
24 : watcher_(NULL), 26 : watcher_(NULL),
25 launcher_delegate_(NULL), 27 launcher_delegate_(NULL),
26 locked_(false),
27 spoken_feedback_enabled_(false), 28 spoken_feedback_enabled_(false),
28 high_contrast_enabled_(false), 29 high_contrast_enabled_(false),
29 screen_magnifier_enabled_(false), 30 screen_magnifier_enabled_(false),
30 screen_magnifier_type_(kDefaultMagnifierType) { 31 screen_magnifier_type_(kDefaultMagnifierType) {
31 } 32 }
32 33
33 ShellDelegateImpl::~ShellDelegateImpl() { 34 ShellDelegateImpl::~ShellDelegateImpl() {
34 } 35 }
35 36
36 void ShellDelegateImpl::SetWatcher(WindowWatcher* watcher) { 37 void ShellDelegateImpl::SetWatcher(WindowWatcher* watcher) {
37 watcher_ = watcher; 38 watcher_ = watcher;
38 if (launcher_delegate_) 39 if (launcher_delegate_)
39 launcher_delegate_->set_watcher(watcher); 40 launcher_delegate_->set_watcher(watcher);
40 } 41 }
41 42
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
54 bool ShellDelegateImpl::IsFirstRunAfterBoot() const { 43 bool ShellDelegateImpl::IsFirstRunAfterBoot() const {
55 return false; 44 return false;
56 } 45 }
57 46
58 bool ShellDelegateImpl::IsMultiProfilesEnabled() const { 47 bool ShellDelegateImpl::IsMultiProfilesEnabled() const {
59 return false; 48 return false;
60 } 49 }
61 50
62 bool ShellDelegateImpl::IsRunningInForcedAppMode() const { 51 bool ShellDelegateImpl::IsRunningInForcedAppMode() const {
63 return false; 52 return false;
64 } 53 }
65 54
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
85 void ShellDelegateImpl::PreInit() { 55 void ShellDelegateImpl::PreInit() {
86 } 56 }
87 57
88 void ShellDelegateImpl::Shutdown() { 58 void ShellDelegateImpl::Shutdown() {
89 } 59 }
90 60
91 void ShellDelegateImpl::Exit() { 61 void ShellDelegateImpl::Exit() {
92 MessageLoopForUI::current()->Quit(); 62 MessageLoopForUI::current()->Quit();
93 } 63 }
94 64
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 161 }
192 162
193 ash::UserWallpaperDelegate* ShellDelegateImpl::CreateUserWallpaperDelegate() { 163 ash::UserWallpaperDelegate* ShellDelegateImpl::CreateUserWallpaperDelegate() {
194 return NULL; 164 return NULL;
195 } 165 }
196 166
197 ash::CapsLockDelegate* ShellDelegateImpl::CreateCapsLockDelegate() { 167 ash::CapsLockDelegate* ShellDelegateImpl::CreateCapsLockDelegate() {
198 return new CapsLockDelegateStub; 168 return new CapsLockDelegateStub;
199 } 169 }
200 170
171 ash::SessionStateDelegate* ShellDelegateImpl::CreateSessionStateDelegate() {
172 return new SessionStateDelegateStub;
173 }
174
201 aura::client::UserActionClient* ShellDelegateImpl::CreateUserActionClient() { 175 aura::client::UserActionClient* ShellDelegateImpl::CreateUserActionClient() {
202 return NULL; 176 return NULL;
203 } 177 }
204 178
205 void ShellDelegateImpl::OpenFeedbackPage() { 179 void ShellDelegateImpl::OpenFeedbackPage() {
206 } 180 }
207 181
208 void ShellDelegateImpl::RecordUserMetricsAction(UserMetricsAction action) { 182 void ShellDelegateImpl::RecordUserMetricsAction(UserMetricsAction action) {
209 } 183 }
210 184
(...skipping 30 matching lines...) Expand all
241 RootWindowHostFactory* ShellDelegateImpl::CreateRootWindowHostFactory() { 215 RootWindowHostFactory* ShellDelegateImpl::CreateRootWindowHostFactory() {
242 return RootWindowHostFactory::Create(); 216 return RootWindowHostFactory::Create();
243 } 217 }
244 218
245 base::string16 ShellDelegateImpl::GetProductName() const { 219 base::string16 ShellDelegateImpl::GetProductName() const {
246 return base::string16(); 220 return base::string16();
247 } 221 }
248 222
249 } // namespace shell 223 } // namespace shell
250 } // namespace ash 224 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/shell_delegate_impl.h ('k') | ash/shell/window_type_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698