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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <iterator> | 9 #include <iterator> |
10 #include <map> | 10 #include <map> |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 return requested_locale; | 344 return requested_locale; |
345 | 345 |
346 return loaded_locale; | 346 return loaded_locale; |
347 } | 347 } |
348 | 348 |
349 void ResolveLanguageListOnBlockingPool( | 349 void ResolveLanguageListOnBlockingPool( |
350 std::unique_ptr<chromeos::locale_util::LanguageSwitchResult> | 350 std::unique_ptr<chromeos::locale_util::LanguageSwitchResult> |
351 language_switch_result, | 351 language_switch_result, |
352 const scoped_refptr<base::TaskRunner> task_runner, | 352 const scoped_refptr<base::TaskRunner> task_runner, |
353 const UILanguageListResolvedCallback& resolved_callback) { | 353 const UILanguageListResolvedCallback& resolved_callback) { |
354 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); | 354 // DCHECK(task_runner->RunsTasksInCurrentSequence()); |
| 355 base::ThreadRestrictions::AssertIOAllowed(); |
355 | 356 |
356 std::string selected_language; | 357 std::string selected_language; |
357 if (!language_switch_result) { | 358 if (!language_switch_result) { |
358 selected_language = | 359 selected_language = |
359 StartupCustomizationDocument::GetInstance()->initial_locale_default(); | 360 StartupCustomizationDocument::GetInstance()->initial_locale_default(); |
360 } else { | 361 } else { |
361 if (language_switch_result->success) { | 362 if (language_switch_result->success) { |
362 if (language_switch_result->requested_locale == | 363 if (language_switch_result->requested_locale == |
363 language_switch_result->loaded_locale) { | 364 language_switch_result->loaded_locale) { |
364 selected_language = language_switch_result->requested_locale; | 365 selected_language = language_switch_result->requested_locale; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 std::unique_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() { | 598 std::unique_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() { |
598 const input_method::InputMethodDescriptor current_input_method = | 599 const input_method::InputMethodDescriptor current_input_method = |
599 input_method::InputMethodManager::Get() | 600 input_method::InputMethodManager::Get() |
600 ->GetActiveIMEState() | 601 ->GetActiveIMEState() |
601 ->GetCurrentInputMethod(); | 602 ->GetCurrentInputMethod(); |
602 return CreateInputMethodsEntry(current_input_method, | 603 return CreateInputMethodsEntry(current_input_method, |
603 current_input_method.id()); | 604 current_input_method.id()); |
604 } | 605 } |
605 | 606 |
606 } // namespace chromeos | 607 } // namespace chromeos |
OLD | NEW |