| 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" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 InitUserPrefs(prefs); | 360 InitUserPrefs(prefs); |
| 361 | 361 |
| 362 user_manager::UserManager::Get()->AddSessionStateObserver(this); | 362 user_manager::UserManager::Get()->AddSessionStateObserver(this); |
| 363 | 363 |
| 364 // This causes OnIsSyncingChanged to be called when the value of | 364 // This causes OnIsSyncingChanged to be called when the value of |
| 365 // PrefService::IsSyncing() changes. | 365 // PrefService::IsSyncing() changes. |
| 366 prefs->AddObserver(this); | 366 prefs->AddObserver(this); |
| 367 | 367 |
| 368 UserSessionManager* session_manager = UserSessionManager::GetInstance(); | 368 UserSessionManager* session_manager = UserSessionManager::GetInstance(); |
| 369 DCHECK(session_manager); | 369 DCHECK(session_manager); |
| 370 ime_state_ = session_manager->GetDefaultIMEState( | 370 ime_state_ = session_manager->GetDefaultIMEState(profile); |
| 371 ProfileHelper::Get()->GetProfileByUser(user_)); | |
| 372 input_method_manager_->SetState(ime_state_); | 371 input_method_manager_->SetState(ime_state_); |
| 373 | 372 |
| 374 // Initialize preferences to currently saved state. | 373 // Initialize preferences to currently saved state. |
| 375 ApplyPreferences(REASON_INITIALIZATION, ""); | 374 ApplyPreferences(REASON_INITIALIZATION, ""); |
| 376 | 375 |
| 377 // If a guest is logged in, initialize the prefs as if this is the first | 376 // If a guest is logged in, initialize the prefs as if this is the first |
| 378 // login. For a regular user this is done in | 377 // login. For a regular user this is done in |
| 379 // UserSessionManager::InitProfilePreferences(). | 378 // UserSessionManager::InitProfilePreferences(). |
| 380 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) | 379 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession)) |
| 381 session_manager->SetFirstLoginPrefs(profile, std::string(), std::string()); | 380 session_manager->SetFirstLoginPrefs(profile, std::string(), std::string()); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 touch_hud_projection_enabled_.SetValue(enabled); | 663 touch_hud_projection_enabled_.SetValue(enabled); |
| 665 } | 664 } |
| 666 | 665 |
| 667 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { | 666 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { |
| 668 if (active_user != user_) | 667 if (active_user != user_) |
| 669 return; | 668 return; |
| 670 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 669 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
| 671 } | 670 } |
| 672 | 671 |
| 673 } // namespace chromeos | 672 } // namespace chromeos |
| OLD | NEW |