Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: chrome/browser/chromeos/preferences.cc

Issue 8573025: chromeos: Move EnableScreenLock to PowerManagerClient from PowerLibrary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed power_manager_client.cc from patch Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
satorux1 2011/11/16 23:58:04 You don't need this.
Simon Que 2011/11/18 18:56:08 Done.
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/screen_locker_settings.h"
20 #include "chrome/browser/chromeos/system/touchpad_settings.h" 21 #include "chrome/browser/chromeos/system/touchpad_settings.h"
21 #include "chrome/browser/prefs/pref_member.h" 22 #include "chrome/browser/prefs/pref_member.h"
22 #include "chrome/browser/prefs/pref_service.h" 23 #include "chrome/browser/prefs/pref_service.h"
23 #include "chrome/browser/prefs/scoped_user_pref_update.h" 24 #include "chrome/browser/prefs/scoped_user_pref_update.h"
24 #include "chrome/common/chrome_notification_types.h" 25 #include "chrome/common/chrome_notification_types.h"
25 #include "chrome/common/chrome_switches.h" 26 #include "chrome/common/chrome_switches.h"
26 #include "chrome/common/pref_names.h" 27 #include "chrome/common/pref_names.h"
27 #include "content/public/browser/notification_details.h" 28 #include "content/public/browser/notification_details.h"
28 #include "content/public/browser/notification_source.h" 29 #include "content/public/browser/notification_source.h"
29 #include "googleurl/src/gurl.h" 30 #include "googleurl/src/gurl.h"
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 *pref_name == language_prefs::kMozcIntegerPrefs[i].pref_name) { 450 *pref_name == language_prefs::kMozcIntegerPrefs[i].pref_name) {
450 SetLanguageConfigInteger( 451 SetLanguageConfigInteger(
451 language_prefs::kMozcSectionName, 452 language_prefs::kMozcSectionName,
452 language_prefs::kMozcIntegerPrefs[i].ibus_config_name, 453 language_prefs::kMozcIntegerPrefs[i].ibus_config_name,
453 language_mozc_integer_prefs_[i].GetValue()); 454 language_mozc_integer_prefs_[i].GetValue());
454 } 455 }
455 } 456 }
456 457
457 // Init or update power manager config. 458 // Init or update power manager config.
458 if (!pref_name || *pref_name == prefs::kEnableScreenLock) { 459 if (!pref_name || *pref_name == prefs::kEnableScreenLock) {
459 CrosLibrary::Get()->GetPowerLibrary()->EnableScreenLock( 460 system::screen_locker_settings::EnableScreenLock(
460 enable_screen_lock_.GetValue()); 461 enable_screen_lock_.GetValue());
461 } 462 }
462 } 463 }
463 464
464 void Preferences::SetLanguageConfigBoolean(const char* section, 465 void Preferences::SetLanguageConfigBoolean(const char* section,
465 const char* name, 466 const char* name,
466 bool value) { 467 bool value) {
467 input_method::ImeConfigValue config; 468 input_method::ImeConfigValue config;
468 config.type = input_method::ImeConfigValue::kValueTypeBool; 469 config.type = input_method::ImeConfigValue::kValueTypeBool;
469 config.bool_value = value; 470 config.bool_value = value;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 587
587 // Remove invalid prefs. 588 // Remove invalid prefs.
588 DictionaryPrefUpdate updater(prefs, prefs::kLanguagePreferredVirtualKeyboard); 589 DictionaryPrefUpdate updater(prefs, prefs::kLanguagePreferredVirtualKeyboard);
589 DictionaryValue* pref_value = updater.Get(); 590 DictionaryValue* pref_value = updater.Get();
590 for (size_t i = 0; i < layouts_to_remove.size(); ++i) { 591 for (size_t i = 0; i < layouts_to_remove.size(); ++i) {
591 pref_value->RemoveWithoutPathExpansion(layouts_to_remove[i], NULL); 592 pref_value->RemoveWithoutPathExpansion(layouts_to_remove[i], NULL);
592 } 593 }
593 } 594 }
594 595
595 } // namespace chromeos 596 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698