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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 void SystemTrayDelegateChromeOS::ChangeProfilePicture() { | 359 void SystemTrayDelegateChromeOS::ChangeProfilePicture() { |
360 content::RecordAction( | 360 content::RecordAction( |
361 base::UserMetricsAction("OpenChangeProfilePictureDialog")); | 361 base::UserMetricsAction("OpenChangeProfilePictureDialog")); |
362 ShowSettingsSubPageForActiveUser(chrome::kChangeProfilePictureSubPage); | 362 ShowSettingsSubPageForActiveUser(chrome::kChangeProfilePictureSubPage); |
363 } | 363 } |
364 | 364 |
365 std::string SystemTrayDelegateChromeOS::GetEnterpriseDomain() const { | 365 std::string SystemTrayDelegateChromeOS::GetEnterpriseDomain() const { |
366 return enterprise_domain_; | 366 return enterprise_domain_; |
367 } | 367 } |
368 | 368 |
369 const base::string16 SystemTrayDelegateChromeOS::GetEnterpriseMessage() const { | 369 base::string16 SystemTrayDelegateChromeOS::GetEnterpriseMessage() const { |
370 if (GetEnterpriseDomain().empty()) | 370 if (GetEnterpriseDomain().empty()) |
371 return base::string16(); | 371 return base::string16(); |
372 return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE, | 372 return l10n_util::GetStringFUTF16(IDS_DEVICE_OWNED_BY_NOTICE, |
373 base::UTF8ToUTF16(GetEnterpriseDomain())); | 373 base::UTF8ToUTF16(GetEnterpriseDomain())); |
374 } | 374 } |
375 | 375 |
376 const std::string SystemTrayDelegateChromeOS::GetSupervisedUserManager() const { | 376 std::string SystemTrayDelegateChromeOS::GetSupervisedUserManager() const { |
377 if (!IsUserSupervised()) | 377 if (!IsUserSupervised()) |
378 return std::string(); | 378 return std::string(); |
379 return SupervisedUserServiceFactory::GetForProfile(user_profile_)-> | 379 return SupervisedUserServiceFactory::GetForProfile(user_profile_)-> |
380 GetCustodianEmailAddress(); | 380 GetCustodianEmailAddress(); |
381 } | 381 } |
382 | 382 |
383 const base::string16 | 383 base::string16 |
384 SystemTrayDelegateChromeOS::GetSupervisedUserManagerName() const { | 384 SystemTrayDelegateChromeOS::GetSupervisedUserManagerName() const { |
385 if (!IsUserSupervised()) | 385 if (!IsUserSupervised()) |
386 return base::string16(); | 386 return base::string16(); |
387 return base::UTF8ToUTF16(SupervisedUserServiceFactory::GetForProfile( | 387 return base::UTF8ToUTF16(SupervisedUserServiceFactory::GetForProfile( |
388 user_profile_)->GetCustodianName()); | 388 user_profile_)->GetCustodianName()); |
389 } | 389 } |
390 | 390 |
391 const base::string16 SystemTrayDelegateChromeOS::GetSupervisedUserMessage() | 391 base::string16 SystemTrayDelegateChromeOS::GetSupervisedUserMessage() |
392 const { | 392 const { |
393 if (!IsUserSupervised()) | 393 if (!IsUserSupervised()) |
394 return base::string16(); | 394 return base::string16(); |
395 if (IsUserChild()) | 395 if (IsUserChild()) |
396 return GetChildUserMessage(); | 396 return GetChildUserMessage(); |
397 return GetLegacySupervisedUserMessage(); | 397 return GetLegacySupervisedUserMessage(); |
398 } | 398 } |
399 | 399 |
400 bool SystemTrayDelegateChromeOS::IsUserSupervised() const { | 400 bool SystemTrayDelegateChromeOS::IsUserSupervised() const { |
401 user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser(); | 401 user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser(); |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1327 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
1328 << "ENABLE_SUPERVISED_USERS undefined."; | 1328 << "ENABLE_SUPERVISED_USERS undefined."; |
1329 return base::string16(); | 1329 return base::string16(); |
1330 } | 1330 } |
1331 | 1331 |
1332 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1332 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1333 return new SystemTrayDelegateChromeOS(); | 1333 return new SystemTrayDelegateChromeOS(); |
1334 } | 1334 } |
1335 | 1335 |
1336 } // namespace chromeos | 1336 } // namespace chromeos |
OLD | NEW |