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

Side by Side Diff: ash/system/tray/test_system_tray_delegate.cc

Issue 14295008: Add ash SessionStateDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ready for review. 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
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/system/tray/test_system_tray_delegate.h" 5 #include "ash/system/tray/test_system_tray_delegate.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/session_state_delegate.h"
9 #include "ash/shell.h" 10 #include "ash/shell.h"
10 #include "ash/shell_delegate.h"
11 #include "ash/volume_control_delegate.h" 11 #include "ash/volume_control_delegate.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "base/string16.h" 14 #include "base/string16.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 16
17 namespace ash { 17 namespace ash {
18 namespace test { 18 namespace test {
19 19
20 namespace { 20 namespace {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return "über@tray"; 83 return "über@tray";
84 } 84 }
85 85
86 const gfx::ImageSkia& TestSystemTrayDelegate::GetUserImage() const { 86 const gfx::ImageSkia& TestSystemTrayDelegate::GetUserImage() const {
87 return null_image_; 87 return null_image_;
88 } 88 }
89 89
90 user::LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { 90 user::LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const {
91 // At new user image screen manager->IsUserLoggedIn() would return true 91 // At new user image screen manager->IsUserLoggedIn() would return true
92 // but there's no browser session available yet so use SessionStarted(). 92 // but there's no browser session available yet so use SessionStarted().
93 if (!Shell::GetInstance()->delegate()->IsSessionStarted()) 93 SessionStateDelegate* delegate =
94 Shell::GetInstance()->session_state_delegate();
95
96 if (!delegate->IsActiveUserSessionStarted())
94 return ash::user::LOGGED_IN_NONE; 97 return ash::user::LOGGED_IN_NONE;
95 if (Shell::GetInstance()->IsScreenLocked()) 98 if (delegate->IsScreenLocked())
96 return user::LOGGED_IN_LOCKED; 99 return user::LOGGED_IN_LOCKED;
97 // TODO(nkostylev): Support LOGGED_IN_OWNER, LOGGED_IN_GUEST, LOGGED_IN_KIOSK, 100 // TODO(nkostylev): Support LOGGED_IN_OWNER, LOGGED_IN_GUEST, LOGGED_IN_KIOSK,
98 // LOGGED_IN_PUBLIC. 101 // LOGGED_IN_PUBLIC.
99 return user::LOGGED_IN_USER; 102 return user::LOGGED_IN_USER;
100 } 103 }
101 104
102 bool TestSystemTrayDelegate::IsOobeCompleted() const { 105 bool TestSystemTrayDelegate::IsOobeCompleted() const {
103 return true; 106 return true;
104 } 107 }
105 108
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 base::string16 TestSystemTrayDelegate::FormatTimeDuration( 366 base::string16 TestSystemTrayDelegate::FormatTimeDuration(
364 const base::TimeDelta& delta) const { 367 const base::TimeDelta& delta) const {
365 return base::string16(); 368 return base::string16();
366 } 369 }
367 370
368 void TestSystemTrayDelegate::MaybeSpeak(const std::string& utterance) const { 371 void TestSystemTrayDelegate::MaybeSpeak(const std::string& utterance) const {
369 } 372 }
370 373
371 } // namespace test 374 } // namespace test
372 } // namespace ash 375 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698