| 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/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/session_state_delegate.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/volume_control_delegate.h" | 11 #include "ash/volume_control_delegate.h" |
| 12 #include "base/utf_string_conversions.h" | |
| 13 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 14 #include "base/string16.h" | |
| 15 #include "base/time.h" | 13 #include "base/time.h" |
| 16 | 14 |
| 17 namespace ash { | 15 namespace ash { |
| 18 namespace test { | 16 namespace test { |
| 19 | 17 |
| 20 namespace { | 18 namespace { |
| 21 | 19 |
| 22 class TestVolumeControlDelegate : public VolumeControlDelegate { | 20 class TestVolumeControlDelegate : public VolumeControlDelegate { |
| 23 public: | 21 public: |
| 24 TestVolumeControlDelegate() {} | 22 TestVolumeControlDelegate() {} |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 65 } |
| 68 | 66 |
| 69 void TestSystemTrayDelegate::Shutdown() { | 67 void TestSystemTrayDelegate::Shutdown() { |
| 70 } | 68 } |
| 71 | 69 |
| 72 bool TestSystemTrayDelegate::GetTrayVisibilityOnStartup() { | 70 bool TestSystemTrayDelegate::GetTrayVisibilityOnStartup() { |
| 73 return true; | 71 return true; |
| 74 } | 72 } |
| 75 | 73 |
| 76 // Overridden from SystemTrayDelegate: | 74 // Overridden from SystemTrayDelegate: |
| 77 const base::string16 TestSystemTrayDelegate::GetUserDisplayName() const { | |
| 78 return UTF8ToUTF16("Über tray Über tray Über tray Über tray"); | |
| 79 } | |
| 80 | |
| 81 const std::string TestSystemTrayDelegate::GetUserEmail() const { | |
| 82 return "über@tray"; | |
| 83 } | |
| 84 | |
| 85 const gfx::ImageSkia& TestSystemTrayDelegate::GetUserImage() const { | |
| 86 return null_image_; | |
| 87 } | |
| 88 | |
| 89 user::LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { | 75 user::LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { |
| 90 // At new user image screen manager->IsUserLoggedIn() would return true | 76 // At new user image screen manager->IsUserLoggedIn() would return true |
| 91 // but there's no browser session available yet so use SessionStarted(). | 77 // but there's no browser session available yet so use SessionStarted(). |
| 92 SessionStateDelegate* delegate = | 78 SessionStateDelegate* delegate = |
| 93 Shell::GetInstance()->session_state_delegate(); | 79 Shell::GetInstance()->session_state_delegate(); |
| 94 | 80 |
| 95 if (!delegate->IsActiveUserSessionStarted()) | 81 if (!delegate->IsActiveUserSessionStarted()) |
| 96 return ash::user::LOGGED_IN_NONE; | 82 return ash::user::LOGGED_IN_NONE; |
| 97 if (delegate->IsScreenLocked()) | 83 if (delegate->IsScreenLocked()) |
| 98 return user::LOGGED_IN_LOCKED; | 84 return user::LOGGED_IN_LOCKED; |
| 99 // TODO(nkostylev): Support LOGGED_IN_OWNER, LOGGED_IN_GUEST, LOGGED_IN_KIOSK, | 85 // TODO(nkostylev): Support LOGGED_IN_OWNER, LOGGED_IN_GUEST, LOGGED_IN_KIOSK, |
| 100 // LOGGED_IN_PUBLIC. | 86 // LOGGED_IN_PUBLIC. |
| 101 return user::LOGGED_IN_USER; | 87 return user::LOGGED_IN_USER; |
| 102 } | 88 } |
| 103 | 89 |
| 104 bool TestSystemTrayDelegate::IsOobeCompleted() const { | 90 bool TestSystemTrayDelegate::IsOobeCompleted() const { |
| 105 return true; | 91 return true; |
| 106 } | 92 } |
| 107 | 93 |
| 108 void TestSystemTrayDelegate::GetLoggedInUsers(UserEmailList* users) { | |
| 109 } | |
| 110 | |
| 111 void TestSystemTrayDelegate::SwitchActiveUser(const std::string& email) { | |
| 112 } | |
| 113 | |
| 114 void TestSystemTrayDelegate::ChangeProfilePicture() { | 94 void TestSystemTrayDelegate::ChangeProfilePicture() { |
| 115 } | 95 } |
| 116 | 96 |
| 117 const std::string TestSystemTrayDelegate::GetEnterpriseDomain() const { | 97 const std::string TestSystemTrayDelegate::GetEnterpriseDomain() const { |
| 118 return std::string(); | 98 return std::string(); |
| 119 } | 99 } |
| 120 | 100 |
| 121 const base::string16 TestSystemTrayDelegate::GetEnterpriseMessage() const { | 101 const base::string16 TestSystemTrayDelegate::GetEnterpriseMessage() const { |
| 122 return string16(); | 102 return string16(); |
| 123 } | 103 } |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 base::string16 TestSystemTrayDelegate::FormatTimeDuration( | 353 base::string16 TestSystemTrayDelegate::FormatTimeDuration( |
| 374 const base::TimeDelta& delta) const { | 354 const base::TimeDelta& delta) const { |
| 375 return base::string16(); | 355 return base::string16(); |
| 376 } | 356 } |
| 377 | 357 |
| 378 void TestSystemTrayDelegate::MaybeSpeak(const std::string& utterance) const { | 358 void TestSystemTrayDelegate::MaybeSpeak(const std::string& utterance) const { |
| 379 } | 359 } |
| 380 | 360 |
| 381 } // namespace test | 361 } // namespace test |
| 382 } // namespace ash | 362 } // namespace ash |
| OLD | NEW |