| 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 "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 MachineStatisticsInitializer(); | 27 MachineStatisticsInitializer(); |
| 28 | 28 |
| 29 static MachineStatisticsInitializer* GetInstance(); | 29 static MachineStatisticsInitializer* GetInstance(); |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 DISALLOW_COPY_AND_ASSIGN(MachineStatisticsInitializer); | 32 DISALLOW_COPY_AND_ASSIGN(MachineStatisticsInitializer); |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 MachineStatisticsInitializer::MachineStatisticsInitializer() { | 35 MachineStatisticsInitializer::MachineStatisticsInitializer() { |
| 36 base::MessageLoop loop; | 36 base::MessageLoop loop; |
| 37 chromeos::system::StatisticsProvider::GetInstance()-> | 37 chromeos::system::StatisticsProvider::GetInstance() |
| 38 StartLoadingMachineStatistics(loop.message_loop_proxy(), false); | 38 ->StartLoadingMachineStatistics(loop.task_runner(), false); |
| 39 loop.RunUntilIdle(); | 39 loop.RunUntilIdle(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 // static | 42 // static |
| 43 MachineStatisticsInitializer* MachineStatisticsInitializer::GetInstance() { | 43 MachineStatisticsInitializer* MachineStatisticsInitializer::GetInstance() { |
| 44 return Singleton<MachineStatisticsInitializer>::get(); | 44 return Singleton<MachineStatisticsInitializer>::get(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void VerifyOnlyUILanguages(const base::ListValue& list) { | 47 void VerifyOnlyUILanguages(const base::ListValue& list) { |
| 48 for (size_t i = 0; i < list.GetSize(); ++i) { | 48 for (size_t i = 0; i < list.GetSize(); ++i) { |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 VerifyOnlyUILanguages(*list); | 215 VerifyOnlyUILanguages(*list); |
| 216 | 216 |
| 217 ASSERT_LE(3u, list->GetSize()); | 217 ASSERT_LE(3u, list->GetSize()); |
| 218 | 218 |
| 219 VerifyLanguageCode(*list, 0, "it"); | 219 VerifyLanguageCode(*list, 0, "it"); |
| 220 VerifyLanguageCode(*list, 1, "de"); | 220 VerifyLanguageCode(*list, 1, "de"); |
| 221 VerifyLanguageCode(*list, 2, kMostRelevantLanguagesDivider); | 221 VerifyLanguageCode(*list, 2, kMostRelevantLanguagesDivider); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace chromeos | 224 } // namespace chromeos |
| OLD | NEW |