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

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

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
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/shell.h" 10 #include "ash/shell.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 } 384 }
385 385
386 void Preferences::OnPreferenceChanged(const std::string& pref_name) { 386 void Preferences::OnPreferenceChanged(const std::string& pref_name) {
387 ApplyPreferences(REASON_PREF_CHANGED, pref_name); 387 ApplyPreferences(REASON_PREF_CHANGED, pref_name);
388 } 388 }
389 389
390 void Preferences::ApplyPreferences(ApplyReason reason, 390 void Preferences::ApplyPreferences(ApplyReason reason,
391 const std::string& pref_name) { 391 const std::string& pref_name) {
392 DCHECK(reason != REASON_PREF_CHANGED || !pref_name.empty()); 392 DCHECK(reason != REASON_PREF_CHANGED || !pref_name.empty());
393 const bool user_is_owner = 393 const bool user_is_owner =
394 user_manager::UserManager::Get()->GetOwnerEmail() == user_->email(); 394 user_manager::UserManager::Get()->GetOwnerID() == user_->GetUserID();
395 const bool user_is_active = user_->is_active(); 395 const bool user_is_active = user_->is_active();
396 396
397 system::TouchpadSettings touchpad_settings; 397 system::TouchpadSettings touchpad_settings;
398 system::MouseSettings mouse_settings; 398 system::MouseSettings mouse_settings;
399 399
400 if (user_is_primary_ && (reason == REASON_INITIALIZATION || 400 if (user_is_primary_ && (reason == REASON_INITIALIZATION ||
401 pref_name == prefs::kPerformanceTracingEnabled)) { 401 pref_name == prefs::kPerformanceTracingEnabled)) {
402 const bool enabled = performance_tracing_enabled_.GetValue(); 402 const bool enabled = performance_tracing_enabled_.GetValue();
403 if (enabled) 403 if (enabled)
404 tracing_manager_ = TracingManager::Create(); 404 tracing_manager_ = TracingManager::Create();
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 touch_hud_projection_enabled_.SetValue(enabled); 684 touch_hud_projection_enabled_.SetValue(enabled);
685 } 685 }
686 686
687 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { 687 void Preferences::ActiveUserChanged(const user_manager::User* active_user) {
688 if (active_user != user_) 688 if (active_user != user_)
689 return; 689 return;
690 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); 690 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, "");
691 } 691 }
692 692
693 } // namespace chromeos 693 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698