OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_MODEL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_MODEL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_MODEL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
| 13 #include "base/string16.h" |
13 #include "chrome/browser/language_combobox_model.h" | 14 #include "chrome/browser/language_combobox_model.h" |
14 #include "chrome/browser/pref_member.h" | 15 #include "chrome/browser/pref_member.h" |
15 #include "chrome/browser/pref_service.h" | 16 #include "chrome/browser/pref_service.h" |
16 #include "chrome/browser/profile.h" | 17 #include "chrome/browser/profile.h" |
17 #include "chrome/common/notification_service.h" | 18 #include "chrome/common/notification_service.h" |
18 #include "cros/chromeos_input_method.h" | 19 #include "cros/chromeos_input_method.h" |
19 | 20 |
20 namespace chromeos { | 21 namespace chromeos { |
21 | 22 |
22 // The combobox model is used for adding languages in the language config | 23 // The combobox model is used for adding languages in the language config |
23 // view. | 24 // view. |
24 class AddLanguageComboboxModel : public ::LanguageComboboxModel { | 25 class AddLanguageComboboxModel : public ::LanguageComboboxModel { |
25 public: | 26 public: |
26 AddLanguageComboboxModel(Profile* profile, | 27 AddLanguageComboboxModel(Profile* profile, |
27 const std::vector<std::string>& locale_codes); | 28 const std::vector<std::string>& locale_codes); |
28 // LanguageComboboxModel overrides. | 29 // LanguageComboboxModel overrides. |
29 virtual int GetItemCount(); | 30 virtual int GetItemCount(); |
30 virtual std::wstring GetItemAt(int index); | 31 virtual string16 GetItemAt(int index); |
31 | 32 |
32 // Converts the given index (index of the items in the combobox) to the | 33 // Converts the given index (index of the items in the combobox) to the |
33 // index of the internal language list. The returned index can be used | 34 // index of the internal language list. The returned index can be used |
34 // for GetLocaleFromIndex() and GetLanguageNameAt(). | 35 // for GetLocaleFromIndex() and GetLanguageNameAt(). |
35 int GetLanguageIndex(int index) const; | 36 int GetLanguageIndex(int index) const; |
36 | 37 |
37 // Marks the given language code to be ignored. Ignored languages won't | 38 // Marks the given language code to be ignored. Ignored languages won't |
38 // be shown in the combobox. It would be simpler if we could remove and | 39 // be shown in the combobox. It would be simpler if we could remove and |
39 // add language codes from the model, but ComboboxModel does not allow | 40 // add language codes from the model, but ComboboxModel does not allow |
40 // items to be added/removed. Thus we use |ignore_set_| instead. | 41 // items to be added/removed. Thus we use |ignore_set_| instead. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 std::vector<std::string> supported_language_codes_; | 139 std::vector<std::string> supported_language_codes_; |
139 // List of supported IME IDs like "pinyin" and "m17n:ar:kbd". | 140 // List of supported IME IDs like "pinyin" and "m17n:ar:kbd". |
140 std::vector<std::string> supported_input_method_ids_; | 141 std::vector<std::string> supported_input_method_ids_; |
141 | 142 |
142 DISALLOW_COPY_AND_ASSIGN(LanguageConfigModel); | 143 DISALLOW_COPY_AND_ASSIGN(LanguageConfigModel); |
143 }; | 144 }; |
144 | 145 |
145 } // namespace chromeos | 146 } // namespace chromeos |
146 | 147 |
147 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_MODEL_H_ | 148 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_MODEL_H_ |
OLD | NEW |