| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/autoclick/autoclick_controller.h" | 9 #include "ash/autoclick/autoclick_controller.h" |
| 10 #include "ash/magnifier/magnifier_constants.h" | 10 #include "ash/magnifier/magnifier_constants.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 registry->RegisterBooleanPref( | 112 registry->RegisterBooleanPref( |
| 113 prefs::kTapDraggingEnabled, | 113 prefs::kTapDraggingEnabled, |
| 114 false, | 114 false, |
| 115 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); | 115 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); |
| 116 registry->RegisterBooleanPref( | 116 registry->RegisterBooleanPref( |
| 117 prefs::kEnableTouchpadThreeFingerClick, | 117 prefs::kEnableTouchpadThreeFingerClick, |
| 118 false, | 118 false, |
| 119 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 119 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 120 registry->RegisterBooleanPref( | 120 registry->RegisterBooleanPref( |
| 121 prefs::kNaturalScroll, | 121 prefs::kNaturalScroll, |
| 122 CommandLine::ForCurrentProcess()->HasSwitch( | 122 ui::ShouldDefaultToNaturalScroll(), |
| 123 switches::kNaturalScrollDefault), | |
| 124 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); | 123 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); |
| 125 registry->RegisterBooleanPref( | 124 registry->RegisterBooleanPref( |
| 126 prefs::kPrimaryMouseButtonRight, | 125 prefs::kPrimaryMouseButtonRight, |
| 127 false, | 126 false, |
| 128 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); | 127 user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); |
| 129 registry->RegisterBooleanPref( | 128 registry->RegisterBooleanPref( |
| 130 prefs::kLabsMediaplayerEnabled, | 129 prefs::kLabsMediaplayerEnabled, |
| 131 false, | 130 false, |
| 132 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 131 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 133 registry->RegisterBooleanPref( | 132 registry->RegisterBooleanPref( |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 } | 557 } |
| 559 } | 558 } |
| 560 | 559 |
| 561 void Preferences::OnIsSyncingChanged() { | 560 void Preferences::OnIsSyncingChanged() { |
| 562 DVLOG(1) << "OnIsSyncingChanged"; | 561 DVLOG(1) << "OnIsSyncingChanged"; |
| 563 ForceNaturalScrollDefault(); | 562 ForceNaturalScrollDefault(); |
| 564 } | 563 } |
| 565 | 564 |
| 566 void Preferences::ForceNaturalScrollDefault() { | 565 void Preferences::ForceNaturalScrollDefault() { |
| 567 DVLOG(1) << "ForceNaturalScrollDefault"; | 566 DVLOG(1) << "ForceNaturalScrollDefault"; |
| 568 if (CommandLine::ForCurrentProcess()->HasSwitch( | 567 if (ui::ShouldDefaultToNaturalScroll() && |
| 569 switches::kNaturalScrollDefault) && | |
| 570 prefs_->IsSyncing() && | 568 prefs_->IsSyncing() && |
| 571 !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { | 569 !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { |
| 572 DVLOG(1) << "Natural scroll forced to true"; | 570 DVLOG(1) << "Natural scroll forced to true"; |
| 573 natural_scroll_.SetValue(true); | 571 natural_scroll_.SetValue(true); |
| 574 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); | 572 UMA_HISTOGRAM_BOOLEAN("Touchpad.NaturalScroll.Forced", true); |
| 575 } | 573 } |
| 576 } | 574 } |
| 577 | 575 |
| 578 void Preferences::SetLanguageConfigStringListAsCSV(const char* section, | 576 void Preferences::SetLanguageConfigStringListAsCSV(const char* section, |
| 579 const char* name, | 577 const char* name, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 touch_hud_projection_enabled_.SetValue(enabled); | 639 touch_hud_projection_enabled_.SetValue(enabled); |
| 642 } | 640 } |
| 643 | 641 |
| 644 void Preferences::ActiveUserChanged(const User* active_user) { | 642 void Preferences::ActiveUserChanged(const User* active_user) { |
| 645 if (active_user != user_) | 643 if (active_user != user_) |
| 646 return; | 644 return; |
| 647 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 645 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
| 648 } | 646 } |
| 649 | 647 |
| 650 } // namespace chromeos | 648 } // namespace chromeos |
| OLD | NEW |