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/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/i18n/time_formatting.h" | 13 #include "base/i18n/time_formatting.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/sys_info.h" | 18 #include "base/sys_info.h" |
19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
21 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 21 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
22 #include "chrome/browser/chromeos/drive/file_system_util.h" | 22 #include "chrome/browser/chromeos/drive/file_system_util.h" |
23 #include "chrome/browser/chromeos/input_method/input_method_syncer.h" | 23 #include "chrome/browser/chromeos/input_method/input_method_syncer.h" |
24 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 24 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
25 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" | 25 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" |
| 26 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
26 #include "chrome/browser/chromeos/system/input_device_settings.h" | 27 #include "chrome/browser/chromeos/system/input_device_settings.h" |
27 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" | 28 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" |
28 #include "chrome/browser/download/download_prefs.h" | 29 #include "chrome/browser/download/download_prefs.h" |
29 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 30 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
30 #include "chrome/common/chrome_features.h" | 31 #include "chrome/common/chrome_features.h" |
31 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
32 #include "chromeos/chromeos_switches.h" | 33 #include "chromeos/chromeos_switches.h" |
33 #include "chromeos/system/statistics_provider.h" | 34 #include "chromeos/system/statistics_provider.h" |
34 #include "chromeos/timezone/timezone_resolver.h" | 35 #include "chromeos/timezone/timezone_resolver.h" |
35 #include "components/drive/drive_pref_names.h" | 36 #include "components/drive/drive_pref_names.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 90 |
90 // static | 91 // static |
91 void Preferences::RegisterPrefs(PrefRegistrySimple* registry) { | 92 void Preferences::RegisterPrefs(PrefRegistrySimple* registry) { |
92 registry->RegisterBooleanPref(prefs::kOwnerPrimaryMouseButtonRight, false); | 93 registry->RegisterBooleanPref(prefs::kOwnerPrimaryMouseButtonRight, false); |
93 registry->RegisterBooleanPref(prefs::kOwnerTapToClickEnabled, true); | 94 registry->RegisterBooleanPref(prefs::kOwnerTapToClickEnabled, true); |
94 registry->RegisterBooleanPref(prefs::kAccessibilityVirtualKeyboardEnabled, | 95 registry->RegisterBooleanPref(prefs::kAccessibilityVirtualKeyboardEnabled, |
95 false); | 96 false); |
96 registry->RegisterStringPref(prefs::kLogoutStartedLast, std::string()); | 97 registry->RegisterStringPref(prefs::kLogoutStartedLast, std::string()); |
97 registry->RegisterBooleanPref(prefs::kResolveDeviceTimezoneByGeolocation, | 98 registry->RegisterBooleanPref(prefs::kResolveDeviceTimezoneByGeolocation, |
98 true); | 99 true); |
| 100 registry->RegisterIntegerPref( |
| 101 prefs::kSystemTimezoneAutomaticDetectionPolicy, |
| 102 enterprise_management::SystemTimezoneAutomaticDetectionProto:: |
| 103 USERS_DECIDE); |
99 } | 104 } |
100 | 105 |
101 // static | 106 // static |
102 void Preferences::RegisterProfilePrefs( | 107 void Preferences::RegisterProfilePrefs( |
103 user_prefs::PrefRegistrySyncable* registry) { | 108 user_prefs::PrefRegistrySyncable* registry) { |
104 std::string hardware_keyboard_id; | 109 std::string hardware_keyboard_id; |
105 // TODO(yusukes): Remove the runtime hack. | 110 // TODO(yusukes): Remove the runtime hack. |
106 if (base::SysInfo::IsRunningOnChromeOS()) { | 111 if (base::SysInfo::IsRunningOnChromeOS()) { |
107 DCHECK(g_browser_process); | 112 DCHECK(g_browser_process); |
108 PrefService* local_state = g_browser_process->local_state(); | 113 PrefService* local_state = g_browser_process->local_state(); |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 touch_hud_projection_enabled_.SetValue(enabled); | 750 touch_hud_projection_enabled_.SetValue(enabled); |
746 } | 751 } |
747 | 752 |
748 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { | 753 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { |
749 if (active_user != user_) | 754 if (active_user != user_) |
750 return; | 755 return; |
751 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 756 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
752 } | 757 } |
753 | 758 |
754 } // namespace chromeos | 759 } // namespace chromeos |
OLD | NEW |