Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2287)

Unified Diff: chrome/browser/ui/webui/chromeos/login/l10n_util.h

Issue 620563002: ChromeOS NetworkScreenHandler should not call CheckAndResolveLocale on UI thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/login/l10n_util.h
diff --git a/chrome/browser/ui/webui/chromeos/login/l10n_util.h b/chrome/browser/ui/webui/chromeos/login/l10n_util.h
index 756e728399e0b68e095d0b406faba2bf2034f76f..9f06b83c0ade0fe147a06227e5a75798374f65a7 100644
--- a/chrome/browser/ui/webui/chromeos/login/l10n_util.h
+++ b/chrome/browser/ui/webui/chromeos/login/l10n_util.h
@@ -10,6 +10,8 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
+#include "base/strings/string16.h"
+#include "chrome/browser/chromeos/base/locale_util.h"
namespace base {
class DictionaryValue;
@@ -18,6 +20,11 @@ class ListValue;
namespace chromeos {
+typedef base::Callback<void(scoped_ptr<base::ListValue> /* new_language_list */,
+ std::string /* new_language_list_locale */,
+ std::string /* new_selected_language */)>
+ UILanguageListResolvedCallback;
+
// GetUILanguageList() returns a concatenated list of the most relevant
// languages followed by all others. An entry with its "code" attribute set to
// this value is inserted in between.
@@ -37,6 +44,17 @@ scoped_ptr<base::ListValue> GetUILanguageList(
const std::vector<std::string>* most_relevant_language_codes,
const std::string& selected);
+// Must be called on UI thread. Runs GetUILanguageList(), on Blocking Pool,
+// and calls |callback| on UI thread with result.
+void ResolveUILanguageList(
+ scoped_ptr<locale_util::LanguageSwitchResult> language_switch_result,
+ UILanguageListResolvedCallback callback);
+
+// Returns a minimal list of UI languages, which consists of active language
+// only. It is used as a placeholder until ResolveUILanguageList() finishes
+// on BlockingPool.
+scoped_ptr<base::ListValue> GetMinimalUILanguageList();
+
// Returns the most first entry of |most_relevant_language_codes| that is
// actually available (present in |available_locales|). If none of the entries
// are present in |available_locales|, returns the |fallback_locale|.

Powered by Google App Engine
This is Rietveld 408576698