| 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/common/accessibility_types.h" | 10 #include "ash/common/accessibility_types.h" |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 } | 615 } |
| 616 } | 616 } |
| 617 | 617 |
| 618 if (reason != REASON_PREF_CHANGED || | 618 if (reason != REASON_PREF_CHANGED || |
| 619 pref_name == prefs::kLanguageXkbAutoRepeatEnabled) { | 619 pref_name == prefs::kLanguageXkbAutoRepeatEnabled) { |
| 620 if (user_is_active) { | 620 if (user_is_active) { |
| 621 const bool enabled = xkb_auto_repeat_enabled_.GetValue(); | 621 const bool enabled = xkb_auto_repeat_enabled_.GetValue(); |
| 622 input_method::InputMethodManager::Get() | 622 input_method::InputMethodManager::Get() |
| 623 ->GetImeKeyboard() | 623 ->GetImeKeyboard() |
| 624 ->SetAutoRepeatEnabled(enabled); | 624 ->SetAutoRepeatEnabled(enabled); |
| 625 |
| 626 user_manager::known_user::SetBooleanPref( |
| 627 user_->GetAccountId(), prefs::kLanguageXkbAutoRepeatEnabled, enabled); |
| 625 } | 628 } |
| 626 } | 629 } |
| 627 if (reason != REASON_PREF_CHANGED || | 630 if (reason != REASON_PREF_CHANGED || |
| 628 pref_name == prefs::kLanguageXkbAutoRepeatDelay || | 631 pref_name == prefs::kLanguageXkbAutoRepeatDelay || |
| 629 pref_name == prefs::kLanguageXkbAutoRepeatInterval) { | 632 pref_name == prefs::kLanguageXkbAutoRepeatInterval) { |
| 630 if (user_is_active) | 633 if (user_is_active) |
| 631 UpdateAutoRepeatRate(); | 634 UpdateAutoRepeatRate(); |
| 632 } | 635 } |
| 633 | 636 |
| 634 if (reason == REASON_INITIALIZATION) | 637 if (reason == REASON_INITIALIZATION) |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 | 782 |
| 780 void Preferences::UpdateAutoRepeatRate() { | 783 void Preferences::UpdateAutoRepeatRate() { |
| 781 input_method::AutoRepeatRate rate; | 784 input_method::AutoRepeatRate rate; |
| 782 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); | 785 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); |
| 783 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); | 786 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); |
| 784 DCHECK(rate.initial_delay_in_ms > 0); | 787 DCHECK(rate.initial_delay_in_ms > 0); |
| 785 DCHECK(rate.repeat_interval_in_ms > 0); | 788 DCHECK(rate.repeat_interval_in_ms > 0); |
| 786 input_method::InputMethodManager::Get() | 789 input_method::InputMethodManager::Get() |
| 787 ->GetImeKeyboard() | 790 ->GetImeKeyboard() |
| 788 ->SetAutoRepeatRate(rate); | 791 ->SetAutoRepeatRate(rate); |
| 792 |
| 793 user_manager::known_user::SetIntegerPref(user_->GetAccountId(), |
| 794 prefs::kLanguageXkbAutoRepeatDelay, |
| 795 rate.initial_delay_in_ms); |
| 796 user_manager::known_user::SetIntegerPref( |
| 797 user_->GetAccountId(), prefs::kLanguageXkbAutoRepeatInterval, |
| 798 rate.repeat_interval_in_ms); |
| 789 } | 799 } |
| 790 | 800 |
| 791 void Preferences::OnTouchHudProjectionToggled(bool enabled) { | 801 void Preferences::OnTouchHudProjectionToggled(bool enabled) { |
| 792 if (touch_hud_projection_enabled_.GetValue() == enabled) | 802 if (touch_hud_projection_enabled_.GetValue() == enabled) |
| 793 return; | 803 return; |
| 794 if (!user_->is_active()) | 804 if (!user_->is_active()) |
| 795 return; | 805 return; |
| 796 touch_hud_projection_enabled_.SetValue(enabled); | 806 touch_hud_projection_enabled_.SetValue(enabled); |
| 797 } | 807 } |
| 798 | 808 |
| 799 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { | 809 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { |
| 800 if (active_user != user_) | 810 if (active_user != user_) |
| 801 return; | 811 return; |
| 802 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 812 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
| 803 } | 813 } |
| 804 | 814 |
| 805 } // namespace chromeos | 815 } // namespace chromeos |
| OLD | NEW |