| 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/magnifier/magnifier_constants.h" | 10 #include "ash/magnifier/magnifier_constants.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/prefs/pref_member.h" | 15 #include "base/prefs/pref_member.h" |
| 16 #include "base/prefs/pref_registry_simple.h" | 16 #include "base/prefs/pref_registry_simple.h" |
| 17 #include "base/prefs/scoped_user_pref_update.h" | 17 #include "base/prefs/scoped_user_pref_update.h" |
| 18 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
| 19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/sys_info.h" | 21 #include "base/sys_info.h" |
| 22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/chrome_notification_types.h" | 23 #include "chrome/browser/chrome_notification_types.h" |
| 24 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 24 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 25 #include "chrome/browser/chromeos/drive/file_system_util.h" | 25 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 26 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 26 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 27 #include "chrome/browser/chromeos/login/session/session_manager.h" | 27 #include "chrome/browser/chromeos/login/login_utils.h" |
| 28 #include "chrome/browser/chromeos/login/users/user.h" | 28 #include "chrome/browser/chromeos/login/users/user.h" |
| 29 #include "chrome/browser/chromeos/system/input_device_settings.h" | 29 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 30 #include "chrome/browser/download/download_prefs.h" | 30 #include "chrome/browser/download/download_prefs.h" |
| 31 #include "chrome/browser/prefs/pref_service_syncable.h" | 31 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
| 34 #include "chromeos/chromeos_switches.h" | 34 #include "chromeos/chromeos_switches.h" |
| 35 #include "chromeos/ime/extension_ime_util.h" | 35 #include "chromeos/ime/extension_ime_util.h" |
| 36 #include "chromeos/ime/ime_keyboard.h" | 36 #include "chromeos/ime/ime_keyboard.h" |
| 37 #include "chromeos/ime/input_method_manager.h" | 37 #include "chromeos/ime/input_method_manager.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 UserManager::Get()->AddSessionStateObserver(this); | 354 UserManager::Get()->AddSessionStateObserver(this); |
| 355 | 355 |
| 356 // This causes OnIsSyncingChanged to be called when the value of | 356 // This causes OnIsSyncingChanged to be called when the value of |
| 357 // PrefService::IsSyncing() changes. | 357 // PrefService::IsSyncing() changes. |
| 358 prefs->AddObserver(this); | 358 prefs->AddObserver(this); |
| 359 | 359 |
| 360 // Initialize preferences to currently saved state. | 360 // Initialize preferences to currently saved state. |
| 361 ApplyPreferences(REASON_INITIALIZATION, ""); | 361 ApplyPreferences(REASON_INITIALIZATION, ""); |
| 362 | 362 |
| 363 // If a guest is logged in, initialize the prefs as if this is the first | 363 // If a guest is logged in, initialize the prefs as if this is the first |
| 364 // login. For a regular user this is done in | 364 // login. |
| 365 // SessionManager::InitProfilePreferences(). | 365 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) { |
| 366 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) | 366 LoginUtils::Get()->SetFirstLoginPrefs(prefs); |
| 367 SessionManager::SetFirstLoginPrefs(prefs); | 367 } |
| 368 } | 368 } |
| 369 | 369 |
| 370 void Preferences::InitUserPrefsForTesting(PrefServiceSyncable* prefs, | 370 void Preferences::InitUserPrefsForTesting(PrefServiceSyncable* prefs, |
| 371 const User* user) { | 371 const User* user) { |
| 372 user_ = user; | 372 user_ = user; |
| 373 InitUserPrefs(prefs); | 373 InitUserPrefs(prefs); |
| 374 } | 374 } |
| 375 | 375 |
| 376 void Preferences::SetInputMethodListForTesting() { | 376 void Preferences::SetInputMethodListForTesting() { |
| 377 SetInputMethodList(); | 377 SetInputMethodList(); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 touch_hud_projection_enabled_.SetValue(enabled); | 640 touch_hud_projection_enabled_.SetValue(enabled); |
| 641 } | 641 } |
| 642 | 642 |
| 643 void Preferences::ActiveUserChanged(const User* active_user) { | 643 void Preferences::ActiveUserChanged(const User* active_user) { |
| 644 if (active_user != user_) | 644 if (active_user != user_) |
| 645 return; | 645 return; |
| 646 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 646 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
| 647 } | 647 } |
| 648 | 648 |
| 649 } // namespace chromeos | 649 } // namespace chromeos |
| OLD | NEW |