| 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/autoclick/autoclick_controller.h" | 7 #include "ash/autoclick/autoclick_controller.h" |
| 8 #include "ash/magnifier/magnifier_constants.h" | 8 #include "ash/magnifier/magnifier_constants.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 registry->RegisterBooleanPref( | 109 registry->RegisterBooleanPref( |
| 110 prefs::kTapDraggingEnabled, | 110 prefs::kTapDraggingEnabled, |
| 111 false, | 111 false, |
| 112 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); | 112 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); |
| 113 registry->RegisterBooleanPref( | 113 registry->RegisterBooleanPref( |
| 114 prefs::kEnableTouchpadThreeFingerClick, | 114 prefs::kEnableTouchpadThreeFingerClick, |
| 115 false, | 115 false, |
| 116 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 116 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 117 registry->RegisterBooleanPref( | 117 registry->RegisterBooleanPref( |
| 118 prefs::kNaturalScroll, | 118 prefs::kNaturalScroll, |
| 119 ui::ShouldDefaultToNaturalScroll(), | 119 CommandLine::ForCurrentProcess()->HasSwitch( |
| 120 switches::kNaturalScrollDefault), |
| 120 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); | 121 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); |
| 121 registry->RegisterBooleanPref( | 122 registry->RegisterBooleanPref( |
| 122 prefs::kPrimaryMouseButtonRight, | 123 prefs::kPrimaryMouseButtonRight, |
| 123 false, | 124 false, |
| 124 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); | 125 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); |
| 125 registry->RegisterBooleanPref( | 126 registry->RegisterBooleanPref( |
| 126 prefs::kLabsMediaplayerEnabled, | 127 prefs::kLabsMediaplayerEnabled, |
| 127 false, | 128 false, |
| 128 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 129 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 129 registry->RegisterBooleanPref( | 130 registry->RegisterBooleanPref( |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 } | 579 } |
| 579 } | 580 } |
| 580 | 581 |
| 581 void Preferences::OnIsSyncingChanged() { | 582 void Preferences::OnIsSyncingChanged() { |
| 582 DVLOG(1) << "OnIsSyncingChanged"; | 583 DVLOG(1) << "OnIsSyncingChanged"; |
| 583 ForceNaturalScrollDefault(); | 584 ForceNaturalScrollDefault(); |
| 584 } | 585 } |
| 585 | 586 |
| 586 void Preferences::ForceNaturalScrollDefault() { | 587 void Preferences::ForceNaturalScrollDefault() { |
| 587 DVLOG(1) << "ForceNaturalScrollDefault"; | 588 DVLOG(1) << "ForceNaturalScrollDefault"; |
| 588 if (ui::ShouldDefaultToNaturalScroll() && | 589 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 590 switches::kNaturalScrollDefault) && |
| 589 prefs_->IsSyncing() && | 591 prefs_->IsSyncing() && |
| 590 !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { | 592 !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { |
| 591 DVLOG(1) << "Natural scroll forced to true"; | 593 DVLOG(1) << "Natural scroll forced to true"; |
| 592 natural_scroll_.SetValue(true); | 594 natural_scroll_.SetValue(true); |
| 593 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); | 595 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); |
| 594 } | 596 } |
| 595 } | 597 } |
| 596 | 598 |
| 597 void Preferences::SetLanguageConfigStringListAsCSV(const char* section, | 599 void Preferences::SetLanguageConfigStringListAsCSV(const char* section, |
| 598 const char* name, | 600 const char* name, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 } | 651 } |
| 650 | 652 |
| 651 void Preferences::OnTouchHudProjectionToggled(bool enabled) { | 653 void Preferences::OnTouchHudProjectionToggled(bool enabled) { |
| 652 if (touch_hud_projection_enabled_.GetValue() == enabled) | 654 if (touch_hud_projection_enabled_.GetValue() == enabled) |
| 653 return; | 655 return; |
| 654 | 656 |
| 655 touch_hud_projection_enabled_.SetValue(enabled); | 657 touch_hud_projection_enabled_.SetValue(enabled); |
| 656 } | 658 } |
| 657 | 659 |
| 658 } // namespace chromeos | 660 } // namespace chromeos |
| OLD | NEW |