| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/base/locale_util.h" | 5 #include "chrome/browser/chromeos/base/locale_util.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/task_scheduler/post_task.h" | 10 #include "base/task_scheduler/post_task.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 const bool login_layouts_only, | 117 const bool login_layouts_only, |
| 118 const SwitchLanguageCallback& callback, | 118 const SwitchLanguageCallback& callback, |
| 119 Profile* profile) { | 119 Profile* profile) { |
| 120 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 120 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 121 std::unique_ptr<SwitchLanguageData> data( | 121 std::unique_ptr<SwitchLanguageData> data( |
| 122 new SwitchLanguageData(locale, enable_locale_keyboard_layouts, | 122 new SwitchLanguageData(locale, enable_locale_keyboard_layouts, |
| 123 login_layouts_only, callback, profile)); | 123 login_layouts_only, callback, profile)); |
| 124 base::Closure reloader( | 124 base::Closure reloader( |
| 125 base::Bind(&SwitchLanguageDoReloadLocale, base::Unretained(data.get()))); | 125 base::Bind(&SwitchLanguageDoReloadLocale, base::Unretained(data.get()))); |
| 126 base::PostTaskWithTraitsAndReply( | 126 base::PostTaskWithTraitsAndReply( |
| 127 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 127 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, reloader, |
| 128 base::TaskPriority::BACKGROUND), | |
| 129 reloader, | |
| 130 base::Bind(&FinishSwitchLanguage, base::Passed(std::move(data)))); | 128 base::Bind(&FinishSwitchLanguage, base::Passed(std::move(data)))); |
| 131 } | 129 } |
| 132 | 130 |
| 133 } // namespace locale_util | 131 } // namespace locale_util |
| 134 } // namespace chromeos | 132 } // namespace chromeos |
| OLD | NEW |