OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/shell.h" | 5 #include "ash/shell.h" |
6 #include "ash/system/date/date_default_view.h" | 6 #include "ash/system/date/date_default_view.h" |
7 #include "ash/system/date/date_view.h" | 7 #include "ash/system/date/date_view.h" |
8 #include "ash/system/user/login_status.h" | 8 #include "ash/system/user/login_status.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // If the login display is still showing, exit gracefully. | 44 // If the login display is still showing, exit gracefully. |
45 if (LoginDisplayHost::default_host()) { | 45 if (LoginDisplayHost::default_host()) { |
46 base::MessageLoop::current()->PostTask(FROM_HERE, | 46 base::MessageLoop::current()->PostTask(FROM_HERE, |
47 base::Bind(&chrome::AttemptExit)); | 47 base::Bind(&chrome::AttemptExit)); |
48 content::RunMessageLoop(); | 48 content::RunMessageLoop(); |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 protected: | 52 protected: |
53 void RefreshPolicyAndWaitDeviceSettingsUpdated() { | 53 void RefreshPolicyAndWaitDeviceSettingsUpdated() { |
54 scoped_ptr<CrosSettings::ObserverSubscription> observer = | 54 std::unique_ptr<CrosSettings::ObserverSubscription> observer = |
55 CrosSettings::Get()->AddSettingsObserver( | 55 CrosSettings::Get()->AddSettingsObserver( |
56 kSystemUse24HourClock, | 56 kSystemUse24HourClock, |
57 base::MessageLoop::current()->QuitWhenIdleClosure()); | 57 base::MessageLoop::current()->QuitWhenIdleClosure()); |
58 | 58 |
59 RefreshDevicePolicy(); | 59 RefreshDevicePolicy(); |
60 base::MessageLoop::current()->Run(); | 60 base::MessageLoop::current()->Run(); |
61 } | 61 } |
62 | 62 |
63 static bool GetSystemTrayDelegateShouldUse24HourClock() { | 63 static bool GetSystemTrayDelegateShouldUse24HourClock() { |
64 chromeos::SystemTrayDelegateChromeOS* tray_delegate = | 64 chromeos::SystemTrayDelegateChromeOS* tray_delegate = |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 EXPECT_TRUE(CrosSettings::Get()->GetBoolean(kSystemUse24HourClock, | 164 EXPECT_TRUE(CrosSettings::Get()->GetBoolean(kSystemUse24HourClock, |
165 &system_use_24hour_clock)); | 165 &system_use_24hour_clock)); |
166 EXPECT_FALSE(system_use_24hour_clock); | 166 EXPECT_FALSE(system_use_24hour_clock); |
167 EXPECT_FALSE(GetSystemTrayDelegateShouldUse24HourClock()); | 167 EXPECT_FALSE(GetSystemTrayDelegateShouldUse24HourClock()); |
168 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayTimeHourType()); | 168 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayTimeHourType()); |
169 EXPECT_TRUE(TestPrimarySystemTrayHasDateDefaultView()); | 169 EXPECT_TRUE(TestPrimarySystemTrayHasDateDefaultView()); |
170 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayDateHourType()); | 170 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayDateHourType()); |
171 } | 171 } |
172 | 172 |
173 } // namespace chromeos | 173 } // namespace chromeos |
OLD | NEW |