OLD | NEW |
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 #include "chrome/browser/chromeos/preferences.h" | 5 #include "chrome/browser/chromeos/preferences.h" |
6 | 6 |
7 #include "ash/magnifier/magnifier_constants.h" | 7 #include "ash/magnifier/magnifier_constants.h" |
8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 prefs::kEnableTouchpadThreeFingerClick, | 94 prefs::kEnableTouchpadThreeFingerClick, |
95 false, | 95 false, |
96 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 96 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
97 registry->RegisterBooleanPref( | 97 registry->RegisterBooleanPref( |
98 prefs::kEnableTouchpadThreeFingerSwipe, | 98 prefs::kEnableTouchpadThreeFingerSwipe, |
99 false, | 99 false, |
100 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 100 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
101 registry->RegisterBooleanPref( | 101 registry->RegisterBooleanPref( |
102 prefs::kNaturalScroll, | 102 prefs::kNaturalScroll, |
103 CommandLine::ForCurrentProcess()->HasSwitch( | 103 CommandLine::ForCurrentProcess()->HasSwitch( |
104 ::switches::kNaturalScrollDefault), | 104 switches::kNaturalScrollDefault), |
105 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 105 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
106 registry->RegisterBooleanPref( | 106 registry->RegisterBooleanPref( |
107 prefs::kPrimaryMouseButtonRight, | 107 prefs::kPrimaryMouseButtonRight, |
108 false, | 108 false, |
109 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 109 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
110 registry->RegisterBooleanPref( | 110 registry->RegisterBooleanPref( |
111 prefs::kLabsMediaplayerEnabled, | 111 prefs::kLabsMediaplayerEnabled, |
112 false, | 112 false, |
113 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 113 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
114 registry->RegisterBooleanPref( | 114 registry->RegisterBooleanPref( |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 } | 874 } |
875 | 875 |
876 void Preferences::OnIsSyncingChanged() { | 876 void Preferences::OnIsSyncingChanged() { |
877 DVLOG(1) << "OnIsSyncingChanged"; | 877 DVLOG(1) << "OnIsSyncingChanged"; |
878 ForceNaturalScrollDefault(); | 878 ForceNaturalScrollDefault(); |
879 } | 879 } |
880 | 880 |
881 void Preferences::ForceNaturalScrollDefault() { | 881 void Preferences::ForceNaturalScrollDefault() { |
882 DVLOG(1) << "ForceNaturalScrollDefault"; | 882 DVLOG(1) << "ForceNaturalScrollDefault"; |
883 if (CommandLine::ForCurrentProcess()->HasSwitch( | 883 if (CommandLine::ForCurrentProcess()->HasSwitch( |
884 ::switches::kNaturalScrollDefault) && | 884 switches::kNaturalScrollDefault) && |
885 prefs_->IsSyncing() && | 885 prefs_->IsSyncing() && |
886 !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { | 886 !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { |
887 DVLOG(1) << "Natural scroll forced to true"; | 887 DVLOG(1) << "Natural scroll forced to true"; |
888 natural_scroll_.SetValue(true); | 888 natural_scroll_.SetValue(true); |
889 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); | 889 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); |
890 } | 890 } |
891 } | 891 } |
892 | 892 |
893 void Preferences::SetLanguageConfigBoolean(const char* section, | 893 void Preferences::SetLanguageConfigBoolean(const char* section, |
894 const char* name, | 894 const char* name, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 985 |
986 input_method::AutoRepeatRate rate; | 986 input_method::AutoRepeatRate rate; |
987 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); | 987 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); |
988 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); | 988 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); |
989 DCHECK(rate.initial_delay_in_ms > 0); | 989 DCHECK(rate.initial_delay_in_ms > 0); |
990 DCHECK(rate.repeat_interval_in_ms > 0); | 990 DCHECK(rate.repeat_interval_in_ms > 0); |
991 input_method::XKeyboard::SetAutoRepeatRate(rate); | 991 input_method::XKeyboard::SetAutoRepeatRate(rate); |
992 } | 992 } |
993 | 993 |
994 } // namespace chromeos | 994 } // namespace chromeos |
OLD | NEW |