| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_PREFERENCES_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "chrome/browser/chromeos/language_preferences.h" |
| 11 #include "chrome/browser/pref_member.h" | 12 #include "chrome/browser/pref_member.h" |
| 12 #include "chrome/common/notification_observer.h" | 13 #include "chrome/common/notification_observer.h" |
| 13 | 14 |
| 14 class PrefService; | 15 class PrefService; |
| 15 | 16 |
| 16 namespace chromeos { | 17 namespace chromeos { |
| 17 | 18 |
| 18 // The Preferences class handles Chrome OS preferences. When the class | 19 // The Preferences class handles Chrome OS preferences. When the class |
| 19 // is first initialized, it will initialize the OS settings to what's stored in | 20 // is first initialized, it will initialize the OS settings to what's stored in |
| 20 // the preferences. These include timezones, touchpad settings, etc. | 21 // the preferences. These include timezones, touchpad settings, etc. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 37 | 38 |
| 38 protected: | 39 protected: |
| 39 // This will set the OS settings when the preference changes. | 40 // This will set the OS settings when the preference changes. |
| 40 // If this method is called with NULL, it will set all OS settings to what's | 41 // If this method is called with NULL, it will set all OS settings to what's |
| 41 // stored in the preferences. | 42 // stored in the preferences. |
| 42 virtual void NotifyPrefChanged(const std::wstring* pref_name); | 43 virtual void NotifyPrefChanged(const std::wstring* pref_name); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 void SetTimeZone(const std::wstring& id); | 46 void SetTimeZone(const std::wstring& id); |
| 46 | 47 |
| 47 // Writes boolean |value| to the IME (IBus) configuration daemon. |section| | 48 // Writes boolean |value| to the input method (IBus) configuration daemon. |
| 48 // (e.g. "general") and |name| (e.g. "use_global_engine") should not be NULL. | 49 // |section| (e.g. "general") and |name| (e.g. "use_global_engine") should |
| 50 // not be NULL. |
| 49 void SetLanguageConfigBoolean(const char* section, | 51 void SetLanguageConfigBoolean(const char* section, |
| 50 const char* name, | 52 const char* name, |
| 51 bool value); | 53 bool value); |
| 52 | 54 |
| 53 // Writes string |value| to the IME (IBus) configuration daemon. |section| | 55 // Writes integer |value| to the input method (IBus) configuration daemon. |
| 54 // and |name| should not be NULL. | 56 // |section| and |name| should not be NULL. |
| 57 void SetLanguageConfigInteger(const char* section, |
| 58 const char* name, |
| 59 int value); |
| 60 |
| 61 // Writes string |value| to the input method (IBus) configuration daemon. |
| 62 // |section| and |name| should not be NULL. |
| 55 void SetLanguageConfigString(const char* section, | 63 void SetLanguageConfigString(const char* section, |
| 56 const char* name, | 64 const char* name, |
| 57 const std::wstring& value); | 65 const std::wstring& value); |
| 58 | 66 |
| 59 // Writes a string list to the IME (IBus) configuration daemon. |section| | 67 // Writes a string list to the input method (IBus) configuration daemon. |
| 60 // and |name| should not be NULL. | 68 // |section| and |name| should not be NULL. |
| 61 void SetLanguageConfigStringList(const char* section, | 69 void SetLanguageConfigStringList(const char* section, |
| 62 const char* name, | 70 const char* name, |
| 63 const std::vector<std::wstring>& values); | 71 const std::vector<std::wstring>& values); |
| 64 | 72 |
| 65 // A variant of SetLanguageConfigStringList. You can pass comma-separated | 73 // A variant of SetLanguageConfigStringList. You can pass comma-separated |
| 66 // values. Examples of |value|: "", "Control+space,Hiragana" | 74 // values. Examples of |value|: "", "Control+space,Hiragana" |
| 67 void SetLanguageConfigStringListAsCSV(const char* section, | 75 void SetLanguageConfigStringListAsCSV(const char* section, |
| 68 const char* name, | 76 const char* name, |
| 69 const std::wstring& value); | 77 const std::wstring& value); |
| 70 | 78 |
| 71 StringPrefMember timezone_; | 79 StringPrefMember timezone_; |
| 72 BooleanPrefMember tap_to_click_enabled_; | 80 BooleanPrefMember tap_to_click_enabled_; |
| 73 BooleanPrefMember vert_edge_scroll_enabled_; | 81 BooleanPrefMember vert_edge_scroll_enabled_; |
| 74 IntegerPrefMember speed_factor_; | 82 IntegerPrefMember speed_factor_; |
| 75 IntegerPrefMember sensitivity_; | 83 IntegerPrefMember sensitivity_; |
| 76 // Language (IME) preferences. | 84 |
| 85 // Input method preferences. |
| 77 BooleanPrefMember language_use_global_engine_; | 86 BooleanPrefMember language_use_global_engine_; |
| 78 StringPrefMember language_hotkey_next_engine_; | 87 StringPrefMember language_hotkey_next_engine_; |
| 79 StringPrefMember language_hotkey_trigger_; | 88 StringPrefMember language_hotkey_trigger_; |
| 80 StringPrefMember language_preload_engines_; | 89 StringPrefMember language_preload_engines_; |
| 81 StringPrefMember language_hangul_keyboard_; | 90 StringPrefMember language_hangul_keyboard_; |
| 91 BooleanPrefMember language_pinyin_boolean_prefs_[ |
| 92 ARRAYSIZE_UNSAFE(kPinyinBooleanPrefs)]; |
| 93 IntegerPrefMember language_pinyin_int_prefs_[ |
| 94 ARRAYSIZE_UNSAFE(kPinyinIntegerPrefs)]; |
| 82 | 95 |
| 83 DISALLOW_COPY_AND_ASSIGN(Preferences); | 96 DISALLOW_COPY_AND_ASSIGN(Preferences); |
| 84 }; | 97 }; |
| 85 | 98 |
| 86 } // namespace chromeos | 99 } // namespace chromeos |
| 87 | 100 |
| 88 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ | 101 #endif // CHROME_BROWSER_CHROMEOS_PREFERENCES_H_ |
| OLD | NEW |