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

Unified Diff: chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.h

Issue 397723002: Extract l10n-related parts of NetworkScreenHandler to a helper file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename a few method arguments for consistency. Created 6 years, 5 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/options/chromeos/cros_language_options_handler.h
diff --git a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.h b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.h
index 33f86871df23e8145ab5339695ae2762119ea4c8..0055ab8006c2c4608621f68e7af306fcfe65d3c5 100644
--- a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.h
+++ b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.h
@@ -5,6 +5,9 @@
#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H_
+#include <string>
+#include <vector>
+
#include "base/compiler_specific.h"
#include "chrome/browser/ui/webui/options/language_options_handler.h"
#include "chromeos/ime/component_extension_ime_manager.h"
@@ -13,10 +16,10 @@
namespace chromeos {
namespace options {
-// GetUILanguageList() returns concatenated list of list of vendor languages
-// followed by other languages. An entry with "code" attribute set to this value
-// is inserted in between.
-extern const char kVendorOtherLanguagesListDivider[];
+// 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.
+extern const char kMostRelevantLanguagesDivider[];
// Language options page UI handler for Chrome OS. For non-Chrome OS,
// see LanguageOptionsHnadler.
@@ -51,7 +54,7 @@ class CrosLanguageOptionsHandler
// The return value will look like:
// [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'},
// ...]
- // "most relevant" languages, as set in initial_locale in VPD, will be first
+ // The most relevant languages, as set in initial_locale in VPD, will be first
// in the list.
static base::ListValue* GetAcceptLanguageList(
const input_method::InputMethodDescriptors& descriptors);
@@ -60,12 +63,14 @@ class CrosLanguageOptionsHandler
// The return value will look like:
// [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'},
// ...]
- // "most relevant" languages, as set in initial_locale in VPD, will be first
- // in the list.
- // An entry with "code" attribute set to kVendorOtherLanguagesListDivider is
- // used as a divider to separate "most relevant" languages against other.
+ // The |most_relevant_language_codes| will be first in the list. If
+ // |most_relevant_language_codes| is NULL, a list of most relevant languages
+ // is read from initial_locale in VPD. An entry with its "code" attribute set
+ // to kMostRelevantLanguagesDivider is inserted between the most relevant
+ // languages and all others.
static base::ListValue* GetUILanguageList(
Nikita (slow) 2014/07/17 06:14:54 How about moving GetUILanguageList/GetLanguageList
bartfab (slow) 2014/07/21 14:28:29 Done.
- const input_method::InputMethodDescriptors& descriptors);
+ const input_method::InputMethodDescriptors& descriptors,
+ const std::vector<std::string>* most_relevant_language_codes);
// Converts input method descriptors to the list of input methods.
// The return value will look like:
@@ -98,13 +103,14 @@ class CrosLanguageOptionsHandler
virtual void OnImeComponentExtensionInitialized() OVERRIDE;
// Gets the list of languages with |descriptors| based on
- // |base_language_codes|.
- // |insert_divider| means to insert entry with "code" attribute set to
- // kVendorOtherLanguagesListDivider between "most relevant" languages and
- // other.
+ // |base_language_codes|. The |most_relevant_language_codes| will be first in
+ // the list. If |insert_divider| is true, an entry with its "code" attribute
+ // set to kMostRelevantLanguagesDivider is placed between the most relevant
+ // languages and all others.
static base::ListValue* GetLanguageListInternal(
const input_method::InputMethodDescriptors& descriptors,
const std::vector<std::string>& base_language_codes,
+ const std::vector<std::string>& most_relevant_language_codes,
bool insert_divider);
// OptionsPageUIHandler implementation.

Powered by Google App Engine
This is Rietveld 408576698