| 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 "base/chromeos/chromeos_version.h" |
| 7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 8 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
| 9 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 10 #include "base/string_split.h" | 11 #include "base/string_split.h" |
| 11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 15 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 15 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 16 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 16 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 17 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| 17 #include "chrome/browser/chromeos/login/login_utils.h" | 18 #include "chrome/browser/chromeos/login/login_utils.h" |
| 18 #include "chrome/browser/chromeos/system/input_device_settings.h" | 19 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 19 #include "chrome/browser/chromeos/system/runtime_environment.h" | |
| 20 #include "chrome/browser/chromeos/system/screen_locker_settings.h" | 20 #include "chrome/browser/chromeos/system/screen_locker_settings.h" |
| 21 #include "chrome/browser/prefs/pref_member.h" | 21 #include "chrome/browser/prefs/pref_member.h" |
| 22 #include "chrome/browser/prefs/pref_service.h" | 22 #include "chrome/browser/prefs/pref_service.h" |
| 23 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 23 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 24 #include "chrome/common/chrome_notification_types.h" | 24 #include "chrome/common/chrome_notification_types.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
| 27 #include "content/public/browser/notification_details.h" | 27 #include "content/public/browser/notification_details.h" |
| 28 #include "content/public/browser/notification_source.h" | 28 #include "content/public/browser/notification_source.h" |
| 29 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 input_method::InputMethodManager::GetInstance()->GetXKeyboard()-> | 570 input_method::InputMethodManager::GetInstance()->GetXKeyboard()-> |
| 571 RemapModifierKeys(modifier_map); | 571 RemapModifierKeys(modifier_map); |
| 572 } else { | 572 } else { |
| 573 LOG(ERROR) << "Failed to remap modifier keys. Unexpected value(s): " | 573 LOG(ERROR) << "Failed to remap modifier keys. Unexpected value(s): " |
| 574 << search_remap << ", " << control_remap << ", " << alt_remap; | 574 << search_remap << ", " << control_remap << ", " << alt_remap; |
| 575 } | 575 } |
| 576 } | 576 } |
| 577 | 577 |
| 578 void Preferences::UpdateAutoRepeatRate() { | 578 void Preferences::UpdateAutoRepeatRate() { |
| 579 // Avoid setting repeat rate on desktop dev environment. | 579 // Avoid setting repeat rate on desktop dev environment. |
| 580 if (!system::runtime_environment::IsRunningOnChromeOS()) | 580 if (!base::chromeos::IsRunningOnChromeOS()) |
| 581 return; | 581 return; |
| 582 | 582 |
| 583 input_method::AutoRepeatRate rate; | 583 input_method::AutoRepeatRate rate; |
| 584 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); | 584 rate.initial_delay_in_ms = xkb_auto_repeat_delay_pref_.GetValue(); |
| 585 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); | 585 rate.repeat_interval_in_ms = xkb_auto_repeat_interval_pref_.GetValue(); |
| 586 DCHECK(rate.initial_delay_in_ms > 0); | 586 DCHECK(rate.initial_delay_in_ms > 0); |
| 587 DCHECK(rate.repeat_interval_in_ms > 0); | 587 DCHECK(rate.repeat_interval_in_ms > 0); |
| 588 input_method::XKeyboard::SetAutoRepeatRate(rate); | 588 input_method::XKeyboard::SetAutoRepeatRate(rate); |
| 589 } | 589 } |
| 590 | 590 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 617 | 617 |
| 618 // Remove invalid prefs. | 618 // Remove invalid prefs. |
| 619 DictionaryPrefUpdate updater(prefs, prefs::kLanguagePreferredVirtualKeyboard); | 619 DictionaryPrefUpdate updater(prefs, prefs::kLanguagePreferredVirtualKeyboard); |
| 620 DictionaryValue* pref_value = updater.Get(); | 620 DictionaryValue* pref_value = updater.Get(); |
| 621 for (size_t i = 0; i < layouts_to_remove.size(); ++i) { | 621 for (size_t i = 0; i < layouts_to_remove.size(); ++i) { |
| 622 pref_value->RemoveWithoutPathExpansion(layouts_to_remove[i], NULL); | 622 pref_value->RemoveWithoutPathExpansion(layouts_to_remove[i], NULL); |
| 623 } | 623 } |
| 624 } | 624 } |
| 625 | 625 |
| 626 } // namespace chromeos | 626 } // namespace chromeos |
| OLD | NEW |