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/shell.h" | 10 #include "ash/shell.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
22 #include "chrome/browser/chrome_notification_types.h" | 22 #include "chrome/browser/chrome_notification_types.h" |
23 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 23 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
24 #include "chrome/browser/chromeos/drive/file_system_util.h" | 24 #include "chrome/browser/chromeos/drive/file_system_util.h" |
25 #include "chrome/browser/chromeos/input_method/input_method_syncer.h" | 25 #include "chrome/browser/chromeos/input_method/input_method_syncer.h" |
26 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 26 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
27 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" | 27 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" |
28 #include "chrome/browser/chromeos/system/input_device_settings.h" | 28 #include "chrome/browser/chromeos/system/input_device_settings.h" |
29 #include "chrome/browser/download/download_prefs.h" | 29 #include "chrome/browser/download/download_prefs.h" |
30 #include "chrome/browser/prefs/pref_service_syncable.h" | 30 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 31 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
31 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
32 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
33 #include "chromeos/chromeos_switches.h" | 34 #include "chromeos/chromeos_switches.h" |
34 #include "chromeos/system/statistics_provider.h" | 35 #include "chromeos/system/statistics_provider.h" |
35 #include "chromeos/timezone/timezone_resolver.h" | 36 #include "chromeos/timezone/timezone_resolver.h" |
36 #include "components/drive/drive_pref_names.h" | 37 #include "components/drive/drive_pref_names.h" |
37 #include "components/feedback/tracing_manager.h" | 38 #include "components/feedback/tracing_manager.h" |
38 #include "components/pref_registry/pref_registry_syncable.h" | 39 #include "components/pref_registry/pref_registry_syncable.h" |
39 #include "components/user_manager/user.h" | 40 #include "components/user_manager/user.h" |
40 #include "content/public/browser/browser_thread.h" | 41 #include "content/public/browser/browser_thread.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 wake_on_wifi_ssid_.Init(prefs::kWakeOnWifiSsid, prefs, callback); | 319 wake_on_wifi_ssid_.Init(prefs::kWakeOnWifiSsid, prefs, callback); |
319 | 320 |
320 pref_change_registrar_.Init(prefs); | 321 pref_change_registrar_.Init(prefs); |
321 pref_change_registrar_.Add(prefs::kResolveTimezoneByGeolocation, callback); | 322 pref_change_registrar_.Add(prefs::kResolveTimezoneByGeolocation, callback); |
322 pref_change_registrar_.Add(prefs::kUse24HourClock, callback); | 323 pref_change_registrar_.Add(prefs::kUse24HourClock, callback); |
323 } | 324 } |
324 | 325 |
325 void Preferences::Init(Profile* profile, const user_manager::User* user) { | 326 void Preferences::Init(Profile* profile, const user_manager::User* user) { |
326 DCHECK(profile); | 327 DCHECK(profile); |
327 DCHECK(user); | 328 DCHECK(user); |
328 PrefServiceSyncable* prefs = PrefServiceSyncable::FromProfile(profile); | 329 PrefServiceSyncable* prefs = PrefServiceSyncableFromProfile(profile); |
329 // This causes OnIsSyncingChanged to be called when the value of | 330 // This causes OnIsSyncingChanged to be called when the value of |
330 // PrefService::IsSyncing() changes. | 331 // PrefService::IsSyncing() changes. |
331 prefs->AddObserver(this); | 332 prefs->AddObserver(this); |
332 user_ = user; | 333 user_ = user; |
333 user_is_primary_ = | 334 user_is_primary_ = |
334 user_manager::UserManager::Get()->GetPrimaryUser() == user_; | 335 user_manager::UserManager::Get()->GetPrimaryUser() == user_; |
335 InitUserPrefs(prefs); | 336 InitUserPrefs(prefs); |
336 | 337 |
337 user_manager::UserManager::Get()->AddSessionStateObserver(this); | 338 user_manager::UserManager::Get()->AddSessionStateObserver(this); |
338 | 339 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 touch_hud_projection_enabled_.SetValue(enabled); | 694 touch_hud_projection_enabled_.SetValue(enabled); |
694 } | 695 } |
695 | 696 |
696 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { | 697 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { |
697 if (active_user != user_) | 698 if (active_user != user_) |
698 return; | 699 return; |
699 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 700 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
700 } | 701 } |
701 | 702 |
702 } // namespace chromeos | 703 } // namespace chromeos |
OLD | NEW |