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/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 } | 392 } |
393 | 393 |
394 void Preferences::OnPreferenceChanged(const std::string& pref_name) { | 394 void Preferences::OnPreferenceChanged(const std::string& pref_name) { |
395 ApplyPreferences(REASON_PREF_CHANGED, pref_name); | 395 ApplyPreferences(REASON_PREF_CHANGED, pref_name); |
396 } | 396 } |
397 | 397 |
398 void Preferences::ApplyPreferences(ApplyReason reason, | 398 void Preferences::ApplyPreferences(ApplyReason reason, |
399 const std::string& pref_name) { | 399 const std::string& pref_name) { |
400 DCHECK(reason != REASON_PREF_CHANGED || !pref_name.empty()); | 400 DCHECK(reason != REASON_PREF_CHANGED || !pref_name.empty()); |
401 const bool user_is_owner = | 401 const bool user_is_owner = |
402 user_manager::UserManager::Get()->GetOwnerEmail() == user_->email(); | 402 user_manager::UserManager::Get()->GetOwnerId() == user_->GetUserID(); |
403 const bool user_is_active = user_->is_active(); | 403 const bool user_is_active = user_->is_active(); |
404 | 404 |
405 system::TouchpadSettings touchpad_settings; | 405 system::TouchpadSettings touchpad_settings; |
406 system::MouseSettings mouse_settings; | 406 system::MouseSettings mouse_settings; |
407 | 407 |
408 if (user_is_primary_ && (reason == REASON_INITIALIZATION || | 408 if (user_is_primary_ && (reason == REASON_INITIALIZATION || |
409 pref_name == prefs::kPerformanceTracingEnabled)) { | 409 pref_name == prefs::kPerformanceTracingEnabled)) { |
410 const bool enabled = performance_tracing_enabled_.GetValue(); | 410 const bool enabled = performance_tracing_enabled_.GetValue(); |
411 if (enabled) | 411 if (enabled) |
412 tracing_manager_ = TracingManager::Create(); | 412 tracing_manager_ = TracingManager::Create(); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 touch_hud_projection_enabled_.SetValue(enabled); | 710 touch_hud_projection_enabled_.SetValue(enabled); |
711 } | 711 } |
712 | 712 |
713 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { | 713 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { |
714 if (active_user != user_) | 714 if (active_user != user_) |
715 return; | 715 return; |
716 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 716 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
717 } | 717 } |
718 | 718 |
719 } // namespace chromeos | 719 } // namespace chromeos |
OLD | NEW |