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

Side by Side Diff: chrome/browser/chromeos/language_preferences.h

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again; base::File changes conflicted. Created 7 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 | Annotate | Revision Log
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_CHROMEOS_LANGUAGE_PREFERENCES_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_
6 #define CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_ 6 #define CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_
7 7
8 #include <stddef.h> // For size_t 8 #include <stddef.h> // For size_t
9 9
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_registry_syncable.h"
11 11
12 class PrefRegistrySimple; 12 class PrefRegistrySimple;
13 13
14 // TODO(yusukes): Rename this file to input_method_preference.cc. Since 14 // TODO(yusukes): Rename this file to input_method_preference.cc. Since
15 // "language" usually means UI language, the current file name is confusing. 15 // "language" usually means UI language, the current file name is confusing.
16 // The namespace should also be changed to "namespace input_method {". 16 // The namespace should also be changed to "namespace input_method {".
17 17
18 // This file defines types and declare variables used in "Languages and 18 // This file defines types and declare variables used in "Languages and
19 // Input" settings in Chromium OS. 19 // Input" settings in Chromium OS.
20 namespace chromeos { 20 namespace chromeos {
(...skipping 10 matching lines...) Expand all
31 const char* pref_name; // Chrome preference name. 31 const char* pref_name; // Chrome preference name.
32 DataType default_pref_value; 32 DataType default_pref_value;
33 const char* ibus_config_name; 33 const char* ibus_config_name;
34 // Currently we have 10 combobox items at most. 34 // Currently we have 10 combobox items at most.
35 static const size_t kMaxItems = 11; 35 static const size_t kMaxItems = 11;
36 struct { 36 struct {
37 DataType ibus_config_value; 37 DataType ibus_config_value;
38 int item_message_id; // Resource grd ID for the combobox item. 38 int item_message_id; // Resource grd ID for the combobox item.
39 } values_and_ids[kMaxItems]; 39 } values_and_ids[kMaxItems];
40 int label_message_id; // Resource grd ID for the label. 40 int label_message_id; // Resource grd ID for the label.
41 PrefServiceSyncable::PrefSyncStatus sync_status; 41 PrefRegistrySyncable::PrefSyncStatus sync_status;
42 }; 42 };
43 43
44 // The struct is used for preferences of boolean values, like switches to 44 // The struct is used for preferences of boolean values, like switches to
45 // enable or disable particular features. 45 // enable or disable particular features.
46 struct LanguageBooleanPrefs { 46 struct LanguageBooleanPrefs {
47 const char* pref_name; // Chrome preference name. 47 const char* pref_name; // Chrome preference name.
48 bool default_pref_value; 48 bool default_pref_value;
49 const char* ibus_config_name; 49 const char* ibus_config_name;
50 int message_id; 50 int message_id;
51 PrefServiceSyncable::PrefSyncStatus sync_status; 51 PrefRegistrySyncable::PrefSyncStatus sync_status;
52 }; 52 };
53 53
54 // The struct is used for preferences of integer range values, like the 54 // The struct is used for preferences of integer range values, like the
55 // key repeat rate. 55 // key repeat rate.
56 struct LanguageIntegerRangePreference { 56 struct LanguageIntegerRangePreference {
57 const char* pref_name; // Chrome preference name. 57 const char* pref_name; // Chrome preference name.
58 int default_pref_value; 58 int default_pref_value;
59 int min_pref_value; 59 int min_pref_value;
60 int max_pref_value; 60 int max_pref_value;
61 const char* ibus_config_name; 61 const char* ibus_config_name;
62 int message_id; 62 int message_id;
63 PrefServiceSyncable::PrefSyncStatus sync_status; 63 PrefRegistrySyncable::PrefSyncStatus sync_status;
64 }; 64 };
65 65
66 // --------------------------------------------------------------------------- 66 // ---------------------------------------------------------------------------
67 // For ibus-daemon 67 // For ibus-daemon
68 // --------------------------------------------------------------------------- 68 // ---------------------------------------------------------------------------
69 extern const char kGeneralSectionName[]; 69 extern const char kGeneralSectionName[];
70 extern const char kPreloadEnginesConfigName[]; 70 extern const char kPreloadEnginesConfigName[];
71 71
72 // --------------------------------------------------------------------------- 72 // ---------------------------------------------------------------------------
73 // For Traditional Chinese input method (ibus-mozc-chewing) 73 // For Traditional Chinese input method (ibus-mozc-chewing)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 extern const LanguageBooleanPrefs kPinyinBooleanPrefs[]; 118 extern const LanguageBooleanPrefs kPinyinBooleanPrefs[];
119 // See comments at kNumChewingBooleanPrefs for why we hard-code this here. 119 // See comments at kNumChewingBooleanPrefs for why we hard-code this here.
120 const size_t kNumPinyinBooleanPrefs = 11; 120 const size_t kNumPinyinBooleanPrefs = 11;
121 121
122 extern const LanguageMultipleChoicePreference<int> kPinyinDoublePinyinSchema; 122 extern const LanguageMultipleChoicePreference<int> kPinyinDoublePinyinSchema;
123 123
124 struct PinyinIntegerPref { 124 struct PinyinIntegerPref {
125 const char* pref_name; // Chrome preference name. 125 const char* pref_name; // Chrome preference name.
126 int default_pref_value; 126 int default_pref_value;
127 const char* ibus_config_name; 127 const char* ibus_config_name;
128 PrefServiceSyncable::PrefSyncStatus sync_status; 128 PrefRegistrySyncable::PrefSyncStatus sync_status;
129 // TODO(yusukes): Add message_id if needed. 129 // TODO(yusukes): Add message_id if needed.
130 }; 130 };
131 131
132 extern const PinyinIntegerPref kPinyinIntegerPrefs[]; 132 extern const PinyinIntegerPref kPinyinIntegerPrefs[];
133 const size_t kNumPinyinIntegerPrefs = 1; 133 const size_t kNumPinyinIntegerPrefs = 1;
134 134
135 // --------------------------------------------------------------------------- 135 // ---------------------------------------------------------------------------
136 // For Japanese input method (ibus-mozc) 136 // For Japanese input method (ibus-mozc)
137 // --------------------------------------------------------------------------- 137 // ---------------------------------------------------------------------------
138 extern const char kMozcSectionName[]; 138 extern const char kMozcSectionName[];
(...skipping 23 matching lines...) Expand all
162 // the login screen. 162 // the login screen.
163 extern const char kPreferredKeyboardLayout[]; 163 extern const char kPreferredKeyboardLayout[];
164 164
165 // Registers non-user prefs for the default keyboard layout on the login screen. 165 // Registers non-user prefs for the default keyboard layout on the login screen.
166 void RegisterPrefs(PrefRegistrySimple* registry); 166 void RegisterPrefs(PrefRegistrySimple* registry);
167 167
168 } // language_prefs 168 } // language_prefs
169 } // chromeos 169 } // chromeos
170 170
171 #endif // CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_ 171 #endif // CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_to_mobile_service.cc ('k') | chrome/browser/chromeos/language_preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698