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 <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 scoped_refptr<base::SequencedTaskRunner> background_task_runner = | 481 scoped_refptr<base::SequencedTaskRunner> background_task_runner = |
482 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( | 482 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( |
483 worker_pool->GetNamedSequenceToken(kSequenceToken), | 483 worker_pool->GetNamedSequenceToken(kSequenceToken), |
484 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 484 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
485 | 485 |
486 // Resolve |locale| on a background thread, then continue on the current | 486 // Resolve |locale| on a background thread, then continue on the current |
487 // thread. | 487 // thread. |
488 std::string (*get_application_locale)(const std::string&, bool) = | 488 std::string (*get_application_locale)(const std::string&, bool) = |
489 &l10n_util::GetApplicationLocale; | 489 &l10n_util::GetApplicationLocale; |
490 base::PostTaskAndReplyWithResult( | 490 base::PostTaskAndReplyWithResult( |
491 background_task_runner, | 491 background_task_runner.get(), |
492 FROM_HERE, | 492 FROM_HERE, |
493 base::Bind(get_application_locale, locale, false /* set_icu_locale */), | 493 base::Bind(get_application_locale, locale, false /* set_icu_locale */), |
494 base::Bind(&GetKeyboardLayoutsForResolvedLocale, callback)); | 494 base::Bind(&GetKeyboardLayoutsForResolvedLocale, callback)); |
495 } | 495 } |
496 | 496 |
497 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() { | 497 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() { |
498 const input_method::InputMethodDescriptor current_input_method = | 498 const input_method::InputMethodDescriptor current_input_method = |
499 input_method::InputMethodManager::Get() | 499 input_method::InputMethodManager::Get() |
500 ->GetActiveIMEState() | 500 ->GetActiveIMEState() |
501 ->GetCurrentInputMethod(); | 501 ->GetCurrentInputMethod(); |
502 return CreateInputMethodsEntry(current_input_method, | 502 return CreateInputMethodsEntry(current_input_method, |
503 current_input_method.id()); | 503 current_input_method.id()); |
504 } | 504 } |
505 | 505 |
506 } // namespace chromeos | 506 } // namespace chromeos |
OLD | NEW |