| 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/common/wm_shell.h" |
| 5 #include "ash/shell.h" | 6 #include "ash/shell.h" |
| 6 #include "ash/system/date/date_default_view.h" | 7 #include "ash/system/date/date_default_view.h" |
| 7 #include "ash/system/date/date_view.h" | 8 #include "ash/system/date/date_view.h" |
| 8 #include "ash/system/user/login_status.h" | 9 #include "ash/system/user/login_status.h" |
| 9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 10 #include "base/location.h" | 11 #include "base/location.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 13 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 kSystemUse24HourClock, | 60 kSystemUse24HourClock, |
| 60 base::MessageLoop::current()->QuitWhenIdleClosure()); | 61 base::MessageLoop::current()->QuitWhenIdleClosure()); |
| 61 | 62 |
| 62 RefreshDevicePolicy(); | 63 RefreshDevicePolicy(); |
| 63 base::MessageLoop::current()->Run(); | 64 base::MessageLoop::current()->Run(); |
| 64 } | 65 } |
| 65 | 66 |
| 66 static bool GetSystemTrayDelegateShouldUse24HourClock() { | 67 static bool GetSystemTrayDelegateShouldUse24HourClock() { |
| 67 chromeos::SystemTrayDelegateChromeOS* tray_delegate = | 68 chromeos::SystemTrayDelegateChromeOS* tray_delegate = |
| 68 static_cast<chromeos::SystemTrayDelegateChromeOS*>( | 69 static_cast<chromeos::SystemTrayDelegateChromeOS*>( |
| 69 ash::Shell::GetInstance()->system_tray_delegate()); | 70 ash::WmShell::Get()->system_tray_delegate()); |
| 70 return tray_delegate->GetShouldUse24HourClockForTesting(); | 71 return tray_delegate->GetShouldUse24HourClockForTesting(); |
| 71 } | 72 } |
| 72 | 73 |
| 73 static base::HourClockType TestGetPrimarySystemTrayTimeHourType() { | 74 static base::HourClockType TestGetPrimarySystemTrayTimeHourType() { |
| 74 const ash::TrayDate* tray_date = ash::Shell::GetInstance() | 75 const ash::TrayDate* tray_date = ash::Shell::GetInstance() |
| 75 ->GetPrimarySystemTray() | 76 ->GetPrimarySystemTray() |
| 76 ->GetTrayDateForTesting(); | 77 ->GetTrayDateForTesting(); |
| 77 const ash::tray::TimeView* time_tray = tray_date->GetTimeTrayForTesting(); | 78 const ash::tray::TimeView* time_tray = tray_date->GetTimeTrayForTesting(); |
| 78 | 79 |
| 79 return time_tray->GetHourTypeForTesting(); | 80 return time_tray->GetHourTypeForTesting(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 EXPECT_TRUE(CrosSettings::Get()->GetBoolean(kSystemUse24HourClock, | 168 EXPECT_TRUE(CrosSettings::Get()->GetBoolean(kSystemUse24HourClock, |
| 168 &system_use_24hour_clock)); | 169 &system_use_24hour_clock)); |
| 169 EXPECT_FALSE(system_use_24hour_clock); | 170 EXPECT_FALSE(system_use_24hour_clock); |
| 170 EXPECT_FALSE(GetSystemTrayDelegateShouldUse24HourClock()); | 171 EXPECT_FALSE(GetSystemTrayDelegateShouldUse24HourClock()); |
| 171 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayTimeHourType()); | 172 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayTimeHourType()); |
| 172 EXPECT_TRUE(TestPrimarySystemTrayHasDateDefaultView()); | 173 EXPECT_TRUE(TestPrimarySystemTrayHasDateDefaultView()); |
| 173 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayDateHourType()); | 174 EXPECT_EQ(base::k12HourClock, TestGetPrimarySystemTrayDateHourType()); |
| 174 } | 175 } |
| 175 | 176 |
| 176 } // namespace chromeos | 177 } // namespace chromeos |
| OLD | NEW |