| 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 (!IsUserSupervised()) | 397 if (GetUserLoginStatus() != ash::user::LOGGED_IN_SUPERVISED) |
| 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 | |
| 409 bool SystemTrayDelegateChromeOS::SystemShouldUpgrade() const { | 404 bool SystemTrayDelegateChromeOS::SystemShouldUpgrade() const { |
| 410 return UpgradeDetector::GetInstance()->notify_upgrade(); | 405 return UpgradeDetector::GetInstance()->notify_upgrade(); |
| 411 } | 406 } |
| 412 | 407 |
| 413 base::HourClockType SystemTrayDelegateChromeOS::GetHourClockType() const { | 408 base::HourClockType SystemTrayDelegateChromeOS::GetHourClockType() const { |
| 414 return clock_type_; | 409 return clock_type_; |
| 415 } | 410 } |
| 416 | 411 |
| 417 void SystemTrayDelegateChromeOS::ShowSettings() { | 412 void SystemTrayDelegateChromeOS::ShowSettings() { |
| 418 ShowSettingsSubPageForActiveUser(""); | 413 ShowSettingsSubPageForActiveUser(""); |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 accessibility_subscription_.reset(); | 1292 accessibility_subscription_.reset(); |
| 1298 else | 1293 else |
| 1299 OnAccessibilityModeChanged(details.notify); | 1294 OnAccessibilityModeChanged(details.notify); |
| 1300 } | 1295 } |
| 1301 | 1296 |
| 1302 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1297 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
| 1303 return new SystemTrayDelegateChromeOS(); | 1298 return new SystemTrayDelegateChromeOS(); |
| 1304 } | 1299 } |
| 1305 | 1300 |
| 1306 } // namespace chromeos | 1301 } // namespace chromeos |
| OLD | NEW |