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/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/chromeos/chromeos_version.h" | 9 #include "base/chromeos/chromeos_version.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 Preferences::~Preferences() {} | 65 Preferences::~Preferences() {} |
66 | 66 |
67 // static | 67 // static |
68 void Preferences::RegisterUserPrefs(PrefService* prefs) { | 68 void Preferences::RegisterUserPrefs(PrefService* prefs) { |
69 std::string hardware_keyboard_id; | 69 std::string hardware_keyboard_id; |
70 // TODO(yusukes): Remove the runtime hack. | 70 // TODO(yusukes): Remove the runtime hack. |
71 if (base::chromeos::IsRunningOnChromeOS()) { | 71 if (base::chromeos::IsRunningOnChromeOS()) { |
72 input_method::InputMethodManager* manager = | 72 input_method::InputMethodManager* manager = |
73 input_method::InputMethodManager::GetInstance(); | 73 input_method::InputMethodManager::GetInstance(); |
74 hardware_keyboard_id = | 74 if (manager) { |
75 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); | 75 hardware_keyboard_id = |
| 76 manager->GetInputMethodUtil()->GetHardwareInputMethodId(); |
| 77 } |
76 } else { | 78 } else { |
77 hardware_keyboard_id = "xkb:us::eng"; // only for testing. | 79 hardware_keyboard_id = "xkb:us::eng"; // only for testing. |
78 } | 80 } |
79 | 81 |
80 const bool enable_tap_to_click_default = IsLumpy(); | 82 const bool enable_tap_to_click_default = IsLumpy(); |
81 prefs->RegisterBooleanPref(prefs::kTapToClickEnabled, | 83 prefs->RegisterBooleanPref(prefs::kTapToClickEnabled, |
82 enable_tap_to_click_default, | 84 enable_tap_to_click_default, |
83 PrefService::SYNCABLE_PREF); | 85 PrefService::SYNCABLE_PREF); |
84 prefs->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerClick, | 86 prefs->RegisterBooleanPref(prefs::kEnableTouchpadThreeFingerClick, |
85 false, | 87 false, |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 | 699 |
698 input_method::AutoRepeatRate rate; | 700 input_method::AutoRepeatRate rate; |
699 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); | 701 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); |
700 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); | 702 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); |
701 DCHECK(rate.initial_delay_in_ms > 0); | 703 DCHECK(rate.initial_delay_in_ms > 0); |
702 DCHECK(rate.repeat_interval_in_ms > 0); | 704 DCHECK(rate.repeat_interval_in_ms > 0); |
703 input_method::XKeyboard::SetAutoRepeatRate(rate); | 705 input_method::XKeyboard::SetAutoRepeatRate(rate); |
704 } | 706 } |
705 | 707 |
706 } // namespace chromeos | 708 } // namespace chromeos |
OLD | NEW |