| 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/chromeos/login/ui/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/audio/sounds.h" | 9 #include "ash/audio/sounds.h" |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // The output list |input_method_ids| is sorted by popularity, hence | 151 // The output list |input_method_ids| is sorted by popularity, hence |
| 152 // input_method_ids[0] now contains the most popular keyboard layout | 152 // input_method_ids[0] now contains the most popular keyboard layout |
| 153 // for the given locale. | 153 // for the given locale. |
| 154 layout = input_method_ids[0]; | 154 layout = input_method_ids[0]; |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 if (!layout.empty()) { | 158 if (!layout.empty()) { |
| 159 std::vector<std::string> layouts; | 159 std::vector<std::string> layouts; |
| 160 base::SplitString(layout, ',', &layouts); | 160 base::SplitString(layout, ',', &layouts); |
| 161 manager->MigrateXkbInputMethods(&layouts); | 161 manager->MigrateInputMethods(&layouts); |
| 162 | 162 |
| 163 PrefService* prefs = g_browser_process->local_state(); | 163 PrefService* prefs = g_browser_process->local_state(); |
| 164 prefs->SetString(prefs::kHardwareKeyboardLayout, JoinString(layouts, ",")); | 164 prefs->SetString(prefs::kHardwareKeyboardLayout, JoinString(layouts, ",")); |
| 165 | 165 |
| 166 // This asks the file thread to save the prefs (i.e. doesn't block). | 166 // This asks the file thread to save the prefs (i.e. doesn't block). |
| 167 // The latest values of Local State reside in memory so we can safely | 167 // The latest values of Local State reside in memory so we can safely |
| 168 // get the value of kHardwareKeyboardLayout even if the data is not | 168 // get the value of kHardwareKeyboardLayout even if the data is not |
| 169 // yet saved to disk. | 169 // yet saved to disk. |
| 170 prefs->CommitPendingWrite(); | 170 prefs->CommitPendingWrite(); |
| 171 | 171 |
| (...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 1302 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
| 1303 new locale_util::SwitchLanguageCallback( | 1303 new locale_util::SwitchLanguageCallback( |
| 1304 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); | 1304 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
| 1305 | 1305 |
| 1306 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1306 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1307 locale_util::SwitchLanguage( | 1307 locale_util::SwitchLanguage( |
| 1308 locale, true, true /* login_layouts_only */, callback.Pass()); | 1308 locale, true, true /* login_layouts_only */, callback.Pass()); |
| 1309 } | 1309 } |
| 1310 | 1310 |
| 1311 } // namespace chromeos | 1311 } // namespace chromeos |
| OLD | NEW |