Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
index f3ef877875ad19d3f3d2abdddeac815bf226d497..df19dd9156920287833cca2f2097618f8c98e4cf 100644 |
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
@@ -58,6 +58,8 @@ |
#include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
#include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
#include "chrome/browser/chromeos/options/network_config_view.h" |
+#include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
+#include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.h" |
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
#include "chrome/browser/chromeos/profiles/multiprofiles_intro_dialog.h" |
@@ -1018,8 +1020,12 @@ void SystemTrayDelegateChromeOS::UpdateClockType() { |
GetSystemTrayNotifier()->NotifyDateFormatChanged(); |
// This also works for enterprise-managed devices because they never have |
// local owner. |
- if (user_manager::UserManager::Get()->IsCurrentUserOwner()) |
- CrosSettings::Get()->SetBoolean(kSystemUse24HourClock, use_24_hour_clock); |
+ if (user_manager::UserManager::Get()->IsCurrentUserOwner()) { |
+ Profile* const profile = ProfileManager::GetActiveUserProfile(); |
bartfab (slow)
2015/04/10 08:38:14
ProfileManager::GetActiveUserProfile() is dangerou
Ivan Podogov
2015/04/10 09:50:53
OK, it was changed from that some iterations ago b
|
+ OwnerSettingsServiceChromeOS* const service = |
+ OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile); |
+ service->SetBoolean(kSystemUse24HourClock, use_24_hour_clock); |
+ } |
} |
void SystemTrayDelegateChromeOS::UpdateShowLogoutButtonInTray() { |
@@ -1120,8 +1126,10 @@ void SystemTrayDelegateChromeOS::LoggedInStateChanged() { |
// user's profile has actually been loaded (http://crbug.com/317745). The |
// system tray's time format is updated at login via SetProfile(). |
if (user_manager::UserManager::Get()->IsCurrentUserOwner()) { |
- CrosSettings::Get()->SetBoolean(kSystemUse24HourClock, |
- ShouldUse24HourClock()); |
+ Profile* const profile = ProfileManager::GetActiveUserProfile(); |
bartfab (slow)
2015/04/10 08:38:14
As above, please do not use ProfileManager::GetAct
Ivan Podogov
2015/04/10 09:50:53
Done.
|
+ OwnerSettingsServiceChromeOS* const service = |
+ OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile); |
+ service->SetBoolean(kSystemUse24HourClock, ShouldUse24HourClock()); |
} |
} |