OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 if (GetUserLoginStatus() != ash::user::LOGGED_IN_SUPERVISED) | 387 if (GetUserLoginStatus() != ash::user::LOGGED_IN_SUPERVISED) |
388 return base::string16(); | 388 return base::string16(); |
389 return ChromeUserManager::Get() | 389 return ChromeUserManager::Get() |
390 ->GetSupervisedUserManager() | 390 ->GetSupervisedUserManager() |
391 ->GetManagerDisplayName( | 391 ->GetManagerDisplayName( |
392 user_manager::UserManager::Get()->GetActiveUser()->email()); | 392 user_manager::UserManager::Get()->GetActiveUser()->email()); |
393 } | 393 } |
394 | 394 |
395 const base::string16 SystemTrayDelegateChromeOS::GetSupervisedUserMessage() | 395 const base::string16 SystemTrayDelegateChromeOS::GetSupervisedUserMessage() |
396 const { | 396 const { |
397 if (GetUserLoginStatus() != ash::user::LOGGED_IN_SUPERVISED) | 397 if (!IsUserSupervised()) |
398 return base::string16(); | 398 return base::string16(); |
399 return l10n_util::GetStringFUTF16( | 399 return l10n_util::GetStringFUTF16( |
400 IDS_USER_IS_SUPERVISED_BY_NOTICE, | 400 IDS_USER_IS_SUPERVISED_BY_NOTICE, |
401 base::UTF8ToUTF16(GetSupervisedUserManager())); | 401 base::UTF8ToUTF16(GetSupervisedUserManager())); |
402 } | 402 } |
403 | 403 |
| 404 bool SystemTrayDelegateChromeOS::IsUserSupervised() const { |
| 405 user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser(); |
| 406 return user && user->IsSupervised(); |
| 407 } |
| 408 |
404 bool SystemTrayDelegateChromeOS::SystemShouldUpgrade() const { | 409 bool SystemTrayDelegateChromeOS::SystemShouldUpgrade() const { |
405 return UpgradeDetector::GetInstance()->notify_upgrade(); | 410 return UpgradeDetector::GetInstance()->notify_upgrade(); |
406 } | 411 } |
407 | 412 |
408 base::HourClockType SystemTrayDelegateChromeOS::GetHourClockType() const { | 413 base::HourClockType SystemTrayDelegateChromeOS::GetHourClockType() const { |
409 return clock_type_; | 414 return clock_type_; |
410 } | 415 } |
411 | 416 |
412 void SystemTrayDelegateChromeOS::ShowSettings() { | 417 void SystemTrayDelegateChromeOS::ShowSettings() { |
413 ShowSettingsSubPageForActiveUser(""); | 418 ShowSettingsSubPageForActiveUser(""); |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 accessibility_subscription_.reset(); | 1297 accessibility_subscription_.reset(); |
1293 else | 1298 else |
1294 OnAccessibilityModeChanged(details.notify); | 1299 OnAccessibilityModeChanged(details.notify); |
1295 } | 1300 } |
1296 | 1301 |
1297 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1302 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1298 return new SystemTrayDelegateChromeOS(); | 1303 return new SystemTrayDelegateChromeOS(); |
1299 } | 1304 } |
1300 | 1305 |
1301 } // namespace chromeos | 1306 } // namespace chromeos |
OLD | NEW |