Chromium Code Reviews| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 const std::string& locale) { | 452 const std::string& locale) { |
| 453 base::SequencedWorkerPool* worker_pool = | 453 base::SequencedWorkerPool* worker_pool = |
| 454 content::BrowserThread::GetBlockingPool(); | 454 content::BrowserThread::GetBlockingPool(); |
| 455 scoped_refptr<base::SequencedTaskRunner> background_task_runner = | 455 scoped_refptr<base::SequencedTaskRunner> background_task_runner = |
| 456 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( | 456 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( |
| 457 worker_pool->GetNamedSequenceToken(kSequenceToken), | 457 worker_pool->GetNamedSequenceToken(kSequenceToken), |
| 458 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 458 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
| 459 | 459 |
| 460 // Resolve |locale| on a background thread, then continue on the current | 460 // Resolve |locale| on a background thread, then continue on the current |
| 461 // thread. | 461 // thread. |
| 462 std::string (*get_application_locale)(const std::string&, bool) = | |
| 463 &l10n_util::GetApplicationLocale; | |
|
tony
2014/08/19 18:44:49
Do you have access to g_browser_process or does th
bartfab (slow)
2014/08/20 08:46:25
I do have access to g_browser_process but the sema
| |
| 462 base::PostTaskAndReplyWithResult( | 464 base::PostTaskAndReplyWithResult( |
| 463 background_task_runner, | 465 background_task_runner, |
| 464 FROM_HERE, | 466 FROM_HERE, |
| 465 base::Bind(&l10n_util::GetApplicationLocale, | 467 base::Bind(get_application_locale, locale, false /* set_icu_locale*/ ), |
| 466 locale), | 468 base::Bind(&GetKeyboardLayoutsForResolvedLocale, callback)); |
| 467 base::Bind(&GetKeyboardLayoutsForResolvedLocale, | |
| 468 callback)); | |
| 469 } | 469 } |
| 470 | 470 |
| 471 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() { | 471 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() { |
| 472 const input_method::InputMethodDescriptor current_input_method = | 472 const input_method::InputMethodDescriptor current_input_method = |
| 473 input_method::InputMethodManager::Get() | 473 input_method::InputMethodManager::Get() |
| 474 ->GetActiveIMEState() | 474 ->GetActiveIMEState() |
| 475 ->GetCurrentInputMethod(); | 475 ->GetCurrentInputMethod(); |
| 476 return CreateInputMethodsEntry(current_input_method, | 476 return CreateInputMethodsEntry(current_input_method, |
| 477 current_input_method.id()); | 477 current_input_method.id()); |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace chromeos | 480 } // namespace chromeos |
| OLD | NEW |