| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/chromeos/cros/cros_library.h" | 14 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 15 #include "chrome/browser/chromeos/cros/power_library.h" | 15 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
| 16 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 16 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 17 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 17 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 18 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 18 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| 19 #include "chrome/browser/chromeos/login/login_utils.h" | 19 #include "chrome/browser/chromeos/login/login_utils.h" |
| 20 #include "chrome/browser/chromeos/system/touchpad_settings.h" | 20 #include "chrome/browser/chromeos/system/touchpad_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" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 *pref_name == language_prefs::kMozcIntegerPrefs[i].pref_name) { | 449 *pref_name == language_prefs::kMozcIntegerPrefs[i].pref_name) { |
| 450 SetLanguageConfigInteger( | 450 SetLanguageConfigInteger( |
| 451 language_prefs::kMozcSectionName, | 451 language_prefs::kMozcSectionName, |
| 452 language_prefs::kMozcIntegerPrefs[i].ibus_config_name, | 452 language_prefs::kMozcIntegerPrefs[i].ibus_config_name, |
| 453 language_mozc_integer_prefs_[i].GetValue()); | 453 language_mozc_integer_prefs_[i].GetValue()); |
| 454 } | 454 } |
| 455 } | 455 } |
| 456 | 456 |
| 457 // Init or update power manager config. | 457 // Init or update power manager config. |
| 458 if (!pref_name || *pref_name == prefs::kEnableScreenLock) { | 458 if (!pref_name || *pref_name == prefs::kEnableScreenLock) { |
| 459 CrosLibrary::Get()->GetPowerLibrary()->EnableScreenLock( | 459 DBusThreadManager::Get()->GetPowerManagerClient()->EnableScreenLock( |
| 460 enable_screen_lock_.GetValue()); | 460 enable_screen_lock_.GetValue()); |
| 461 } | 461 } |
| 462 } | 462 } |
| 463 | 463 |
| 464 void Preferences::SetLanguageConfigBoolean(const char* section, | 464 void Preferences::SetLanguageConfigBoolean(const char* section, |
| 465 const char* name, | 465 const char* name, |
| 466 bool value) { | 466 bool value) { |
| 467 input_method::ImeConfigValue config; | 467 input_method::ImeConfigValue config; |
| 468 config.type = input_method::ImeConfigValue::kValueTypeBool; | 468 config.type = input_method::ImeConfigValue::kValueTypeBool; |
| 469 config.bool_value = value; | 469 config.bool_value = value; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 | 586 |
| 587 // Remove invalid prefs. | 587 // Remove invalid prefs. |
| 588 DictionaryPrefUpdate updater(prefs, prefs::kLanguagePreferredVirtualKeyboard); | 588 DictionaryPrefUpdate updater(prefs, prefs::kLanguagePreferredVirtualKeyboard); |
| 589 DictionaryValue* pref_value = updater.Get(); | 589 DictionaryValue* pref_value = updater.Get(); |
| 590 for (size_t i = 0; i < layouts_to_remove.size(); ++i) { | 590 for (size_t i = 0; i < layouts_to_remove.size(); ++i) { |
| 591 pref_value->RemoveWithoutPathExpansion(layouts_to_remove[i], NULL); | 591 pref_value->RemoveWithoutPathExpansion(layouts_to_remove[i], NULL); |
| 592 } | 592 } |
| 593 } | 593 } |
| 594 | 594 |
| 595 } // namespace chromeos | 595 } // namespace chromeos |
| OLD | NEW |