Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: chrome/browser/chromeos/preferences.cc

Issue 543163002: ChromeOS: GetProfileByUser should not be called from Preferences::Init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698