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

Side by Side Diff: chrome/browser/chromeos/dom_ui/language_options_util.cc

Issue 3043023: Add remaining stuff for Mozc configuration DOMUI. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Fix for review comments (real for this time) Created 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "language_options_util.h"
6
7 #include "app/l10n_util.h"
8 #include "base/values.h"
9
10 namespace chromeos {
11
12 ListValue* CreateMultipleChoiceList(
13 const LanguageMultipleChoicePreference<const char*>& preference) {
14 int list_length = 0;
15 for (size_t i = 0;
16 i < LanguageMultipleChoicePreference<const char*>::kMaxItems;
17 ++i) {
18 if (preference.values_and_ids[i].item_message_id == 0)
19 break;
20 ++list_length;
21 }
22 DCHECK_GT(list_length, 0);
23
24 ListValue* list_value = new ListValue();
25 for (int i = 0; i < list_length; ++i) {
26 ListValue* option = new ListValue();
27 option->Append(Value::CreateStringValue(
28 preference.values_and_ids[i].ibus_config_value));
29 option->Append(Value::CreateStringValue(l10n_util::GetString(
30 preference.values_and_ids[i].item_message_id)));
31 list_value->Append(option);
32 }
33 return list_value;
34 }
35
36 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698