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