| 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" |
| 11 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/i18n/time_formatting.h" | 14 #include "base/i18n/time_formatting.h" |
| 15 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
| 16 #include "base/strings/string_split.h" | 16 #include "base/strings/string_split.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "base/sys_info.h" | |
| 20 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 21 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
| 22 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 21 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 23 #include "chrome/browser/chromeos/drive/file_system_util.h" | 22 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 24 #include "chrome/browser/chromeos/input_method/input_method_syncer.h" | 23 #include "chrome/browser/chromeos/input_method/input_method_syncer.h" |
| 25 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 24 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 26 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" | 25 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" |
| 27 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 26 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| 28 #include "chrome/browser/chromeos/system/input_device_settings.h" | 27 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 29 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" | 28 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" |
| 30 #include "chrome/browser/download/download_prefs.h" | 29 #include "chrome/browser/download/download_prefs.h" |
| 31 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 30 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 32 #include "chrome/common/chrome_features.h" | 31 #include "chrome/common/chrome_features.h" |
| 33 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
| 34 #include "chromeos/chromeos_switches.h" | 33 #include "chromeos/chromeos_switches.h" |
| 34 #include "chromeos/system/devicemode.h" |
| 35 #include "chromeos/system/statistics_provider.h" | 35 #include "chromeos/system/statistics_provider.h" |
| 36 #include "chromeos/timezone/timezone_resolver.h" | 36 #include "chromeos/timezone/timezone_resolver.h" |
| 37 #include "components/drive/drive_pref_names.h" | 37 #include "components/drive/drive_pref_names.h" |
| 38 #include "components/feedback/tracing_manager.h" | 38 #include "components/feedback/tracing_manager.h" |
| 39 #include "components/pref_registry/pref_registry_syncable.h" | 39 #include "components/pref_registry/pref_registry_syncable.h" |
| 40 #include "components/prefs/pref_member.h" | 40 #include "components/prefs/pref_member.h" |
| 41 #include "components/prefs/pref_registry_simple.h" | 41 #include "components/prefs/pref_registry_simple.h" |
| 42 #include "components/prefs/scoped_user_pref_update.h" | 42 #include "components/prefs/scoped_user_pref_update.h" |
| 43 #include "components/sync_preferences/pref_service_syncable.h" | 43 #include "components/sync_preferences/pref_service_syncable.h" |
| 44 #include "components/user_manager/known_user.h" | 44 #include "components/user_manager/known_user.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 registry->RegisterIntegerPref( | 104 registry->RegisterIntegerPref( |
| 105 prefs::kSystemTimezoneAutomaticDetectionPolicy, | 105 prefs::kSystemTimezoneAutomaticDetectionPolicy, |
| 106 enterprise_management::SystemTimezoneProto::USERS_DECIDE); | 106 enterprise_management::SystemTimezoneProto::USERS_DECIDE); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // static | 109 // static |
| 110 void Preferences::RegisterProfilePrefs( | 110 void Preferences::RegisterProfilePrefs( |
| 111 user_prefs::PrefRegistrySyncable* registry) { | 111 user_prefs::PrefRegistrySyncable* registry) { |
| 112 std::string hardware_keyboard_id; | 112 std::string hardware_keyboard_id; |
| 113 // TODO(yusukes): Remove the runtime hack. | 113 // TODO(yusukes): Remove the runtime hack. |
| 114 if (base::SysInfo::IsRunningOnChromeOS()) { | 114 if (IsRunningAsSystemCompositor()) { |
| 115 DCHECK(g_browser_process); | 115 DCHECK(g_browser_process); |
| 116 PrefService* local_state = g_browser_process->local_state(); | 116 PrefService* local_state = g_browser_process->local_state(); |
| 117 DCHECK(local_state); | 117 DCHECK(local_state); |
| 118 hardware_keyboard_id = | 118 hardware_keyboard_id = |
| 119 local_state->GetString(prefs::kHardwareKeyboardLayout); | 119 local_state->GetString(prefs::kHardwareKeyboardLayout); |
| 120 } else { | 120 } else { |
| 121 hardware_keyboard_id = "xkb:us::eng"; // only for testing. | 121 hardware_keyboard_id = "xkb:us::eng"; // only for testing. |
| 122 } | 122 } |
| 123 | 123 |
| 124 registry->RegisterBooleanPref(prefs::kPerformanceTracingEnabled, false); | 124 registry->RegisterBooleanPref(prefs::kPerformanceTracingEnabled, false); |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 touch_hud_projection_enabled_.SetValue(enabled); | 796 touch_hud_projection_enabled_.SetValue(enabled); |
| 797 } | 797 } |
| 798 | 798 |
| 799 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { | 799 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { |
| 800 if (active_user != user_) | 800 if (active_user != user_) |
| 801 return; | 801 return; |
| 802 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 802 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
| 803 } | 803 } |
| 804 | 804 |
| 805 } // namespace chromeos | 805 } // namespace chromeos |
| OLD | NEW |