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

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

Issue 144363006: Expand VPD initial_locale to a list of locales. Use the expanded VPD initial_locale on the OOBE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement options group in language select. Fix unittest. Created 6 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H _ 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H _
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H _ 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLER_H _
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "chrome/browser/ui/webui/options/language_options_handler.h" 9 #include "chrome/browser/ui/webui/options/language_options_handler.h"
10 #include "chromeos/ime/component_extension_ime_manager.h" 10 #include "chromeos/ime/component_extension_ime_manager.h"
(...skipping 28 matching lines...) Expand all
39 // Note that true in languageCodeSet does not mean anything. We just use 39 // Note that true in languageCodeSet does not mean anything. We just use
40 // the dictionary as a set. 40 // the dictionary as a set.
41 static base::ListValue* GetInputMethodList( 41 static base::ListValue* GetInputMethodList(
42 const input_method::InputMethodDescriptors& descriptors); 42 const input_method::InputMethodDescriptors& descriptors);
43 43
44 // Gets the list of accept languages with the given input descriptors. 44 // Gets the list of accept languages with the given input descriptors.
45 // Listed languages will be used as Accept-Language header. 45 // Listed languages will be used as Accept-Language header.
46 // The return value will look like: 46 // The return value will look like:
47 // [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'}, 47 // [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'},
48 // ...] 48 // ...]
49 // "most relevant" languages, as set in initial_locale in VPD, will be first
50 // in the list.
49 static base::ListValue* GetAcceptLanguageList( 51 static base::ListValue* GetAcceptLanguageList(
50 const input_method::InputMethodDescriptors& descriptors); 52 const input_method::InputMethodDescriptors& descriptors);
51 53
52 // Gets the list of UI languages with the given input descriptors. 54 // Gets the list of UI languages with the given input descriptors.
53 // The return value will look like: 55 // The return value will look like:
54 // [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'}, 56 // [{'code': 'fi', 'displayName': 'Finnish', 'nativeDisplayName': 'suomi'},
55 // ...] 57 // ...]
58 // "most relevant" languages, as set in initial_locale in VPD, will be first
59 // in the list.
60 // An entry with empty "code" is used as a divider to separate "most
61 // relevant" languages against other.
56 static base::ListValue* GetUILanguageList( 62 static base::ListValue* GetUILanguageList(
57 const input_method::InputMethodDescriptors& descriptors); 63 const input_method::InputMethodDescriptors& descriptors);
58 64
59 // Converts input method descriptors to the list of input methods. 65 // Converts input method descriptors to the list of input methods.
60 // The return value will look like: 66 // The return value will look like:
61 // [{'id': '_ext_ime_nejguenhnsnjnwychcnsdsdjketest', 67 // [{'id': '_ext_ime_nejguenhnsnjnwychcnsdsdjketest',
62 // 'displayName': 'Sample IME'}, ...] 68 // 'displayName': 'Sample IME'}, ...]
63 static base::ListValue* ConvertInputMethodDescriptosToIMEList( 69 static base::ListValue* ConvertInputMethodDescriptosToIMEList(
64 const input_method::InputMethodDescriptors& descriptors); 70 const input_method::InputMethodDescriptors& descriptors);
65 71
(...skipping 15 matching lines...) Expand all
81 87
82 // Called when the input method options page is opened. 88 // Called when the input method options page is opened.
83 // |args| will contain the input method ID as string (ex. "mozc"). 89 // |args| will contain the input method ID as string (ex. "mozc").
84 void InputMethodOptionsOpenCallback(const base::ListValue* args); 90 void InputMethodOptionsOpenCallback(const base::ListValue* args);
85 91
86 // ComponentExtensionIMEManager::Observer override. 92 // ComponentExtensionIMEManager::Observer override.
87 virtual void OnInitialized() OVERRIDE; 93 virtual void OnInitialized() OVERRIDE;
88 94
89 // Gets the list of languages with |descriptors| based on 95 // Gets the list of languages with |descriptors| based on
90 // |base_language_codes|. 96 // |base_language_codes|.
97 // |insert_divider| means to insert empty string between "most relevant"
98 // languages and other.
91 static base::ListValue* GetLanguageListInternal( 99 static base::ListValue* GetLanguageListInternal(
92 const input_method::InputMethodDescriptors& descriptors, 100 const input_method::InputMethodDescriptors& descriptors,
93 const std::vector<std::string>& base_language_codes); 101 const std::vector<std::string>& base_language_codes,
102 const bool insert_divider);
Dmitry Polukhin 2014/01/28 19:40:30 nit, const here has no sense and we usually omit i
Alexander Alekseev 2014/01/29 15:39:00 Done.
94 103
95 // OptionsPageUIHandler implementation. 104 // OptionsPageUIHandler implementation.
96 virtual void InitializePage() OVERRIDE; 105 virtual void InitializePage() OVERRIDE;
97 106
98 // True if the component extension list was appended into input method list. 107 // True if the component extension list was appended into input method list.
99 bool composition_extension_appended_; 108 bool composition_extension_appended_;
100 109
101 // True if this page was initialized. 110 // True if this page was initialized.
102 bool is_page_initialized_; 111 bool is_page_initialized_;
103 112
104 DISALLOW_COPY_AND_ASSIGN(CrosLanguageOptionsHandler); 113 DISALLOW_COPY_AND_ASSIGN(CrosLanguageOptionsHandler);
105 }; 114 };
106 115
107 } // namespace options 116 } // namespace options
108 } // namespace chromeos 117 } // namespace chromeos
109 118
110 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLE R_H_ 119 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CROS_LANGUAGE_OPTIONS_HANDLE R_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698