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 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/chromeos/login/user_manager.h" | 24 #include "chrome/browser/chromeos/login/user_manager.h" |
25 #include "chrome/browser/chromeos/system/drm_settings.h" | 25 #include "chrome/browser/chromeos/system/drm_settings.h" |
26 #include "chrome/browser/chromeos/system/input_device_settings.h" | 26 #include "chrome/browser/chromeos/system/input_device_settings.h" |
27 #include "chrome/browser/chromeos/system/statistics_provider.h" | 27 #include "chrome/browser/chromeos/system/statistics_provider.h" |
28 #include "chrome/browser/download/download_util.h" | 28 #include "chrome/browser/download/download_util.h" |
29 #include "chrome/browser/prefs/pref_service_syncable.h" | 29 #include "chrome/browser/prefs/pref_service_syncable.h" |
30 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 30 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
31 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
33 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
| 34 #include "chromeos/chromeos_switches.h" |
34 #include "chromeos/dbus/dbus_thread_manager.h" | 35 #include "chromeos/dbus/dbus_thread_manager.h" |
35 #include "chromeos/dbus/power_policy_controller.h" | 36 #include "chromeos/dbus/power_policy_controller.h" |
36 #include "chromeos/ime/xkeyboard.h" | 37 #include "chromeos/ime/xkeyboard.h" |
37 #include "components/user_prefs/pref_registry_syncable.h" | 38 #include "components/user_prefs/pref_registry_syncable.h" |
38 #include "googleurl/src/gurl.h" | 39 #include "googleurl/src/gurl.h" |
39 #include "third_party/icu/public/i18n/unicode/timezone.h" | 40 #include "third_party/icu/public/i18n/unicode/timezone.h" |
40 #include "ui/base/events/event_constants.h" | 41 #include "ui/base/events/event_constants.h" |
41 #include "ui/base/events/event_utils.h" | 42 #include "ui/base/events/event_utils.h" |
42 | 43 |
43 namespace chromeos { | 44 namespace chromeos { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 PrefRegistrySyncable::SYNCABLE_PREF); | 90 PrefRegistrySyncable::SYNCABLE_PREF); |
90 registry->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerClick, | 91 registry->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerClick, |
91 false, | 92 false, |
92 PrefRegistrySyncable::UNSYNCABLE_PREF); | 93 PrefRegistrySyncable::UNSYNCABLE_PREF); |
93 registry->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerSwipe, | 94 registry->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerSwipe, |
94 false, | 95 false, |
95 PrefRegistrySyncable::UNSYNCABLE_PREF); | 96 PrefRegistrySyncable::UNSYNCABLE_PREF); |
96 registry->RegisterBooleanPref( | 97 registry->RegisterBooleanPref( |
97 prefs::kNaturalScroll, | 98 prefs::kNaturalScroll, |
98 CommandLine::ForCurrentProcess()->HasSwitch( | 99 CommandLine::ForCurrentProcess()->HasSwitch( |
99 switches::kNaturalScrollDefault), | 100 ::switches::kNaturalScrollDefault), |
100 PrefRegistrySyncable::SYNCABLE_PREF); | 101 PrefRegistrySyncable::SYNCABLE_PREF); |
101 registry->RegisterBooleanPref(prefs::kPrimaryMouseButtonRight, | 102 registry->RegisterBooleanPref(prefs::kPrimaryMouseButtonRight, |
102 false, | 103 false, |
103 PrefRegistrySyncable::SYNCABLE_PREF); | 104 PrefRegistrySyncable::SYNCABLE_PREF); |
104 registry->RegisterBooleanPref(prefs::kLabsMediaplayerEnabled, | 105 registry->RegisterBooleanPref(prefs::kLabsMediaplayerEnabled, |
105 false, | 106 false, |
106 PrefRegistrySyncable::UNSYNCABLE_PREF); | 107 PrefRegistrySyncable::UNSYNCABLE_PREF); |
107 registry->RegisterBooleanPref(prefs::kLabsAdvancedFilesystemEnabled, | 108 registry->RegisterBooleanPref(prefs::kLabsAdvancedFilesystemEnabled, |
108 false, | 109 false, |
109 PrefRegistrySyncable::UNSYNCABLE_PREF); | 110 PrefRegistrySyncable::UNSYNCABLE_PREF); |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 } | 785 } |
785 | 786 |
786 void Preferences::OnIsSyncingChanged() { | 787 void Preferences::OnIsSyncingChanged() { |
787 DVLOG(1) << "OnIsSyncingChanged"; | 788 DVLOG(1) << "OnIsSyncingChanged"; |
788 ForceNaturalScrollDefault(); | 789 ForceNaturalScrollDefault(); |
789 } | 790 } |
790 | 791 |
791 void Preferences::ForceNaturalScrollDefault() { | 792 void Preferences::ForceNaturalScrollDefault() { |
792 DVLOG(1) << "ForceNaturalScrollDefault"; | 793 DVLOG(1) << "ForceNaturalScrollDefault"; |
793 if (CommandLine::ForCurrentProcess()->HasSwitch( | 794 if (CommandLine::ForCurrentProcess()->HasSwitch( |
794 switches::kNaturalScrollDefault) && | 795 ::switches::kNaturalScrollDefault) && |
795 prefs_->IsSyncing() && | 796 prefs_->IsSyncing() && |
796 !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { | 797 !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { |
797 DVLOG(1) << "Natural scroll forced to true"; | 798 DVLOG(1) << "Natural scroll forced to true"; |
798 natural_scroll_.SetValue(true); | 799 natural_scroll_.SetValue(true); |
799 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); | 800 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); |
800 } | 801 } |
801 } | 802 } |
802 | 803 |
803 void Preferences::SetLanguageConfigBoolean(const char* section, | 804 void Preferences::SetLanguageConfigBoolean(const char* section, |
804 const char* name, | 805 const char* name, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 | 892 |
892 input_method::AutoRepeatRate rate; | 893 input_method::AutoRepeatRate rate; |
893 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); | 894 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); |
894 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); | 895 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); |
895 DCHECK(rate.initial_delay_in_ms > 0); | 896 DCHECK(rate.initial_delay_in_ms > 0); |
896 DCHECK(rate.repeat_interval_in_ms > 0); | 897 DCHECK(rate.repeat_interval_in_ms > 0); |
897 input_method::XKeyboard::SetAutoRepeatRate(rate); | 898 input_method::XKeyboard::SetAutoRepeatRate(rate); |
898 } | 899 } |
899 | 900 |
900 } // namespace chromeos | 901 } // namespace chromeos |
OLD | NEW |