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()->GetOwnerAccountId() == |
| 403 user_->GetAccountId(); |
403 const bool user_is_active = user_->is_active(); | 404 const bool user_is_active = user_->is_active(); |
404 | 405 |
405 system::TouchpadSettings touchpad_settings; | 406 system::TouchpadSettings touchpad_settings; |
406 system::MouseSettings mouse_settings; | 407 system::MouseSettings mouse_settings; |
407 | 408 |
408 if (user_is_primary_ && (reason == REASON_INITIALIZATION || | 409 if (user_is_primary_ && (reason == REASON_INITIALIZATION || |
409 pref_name == prefs::kPerformanceTracingEnabled)) { | 410 pref_name == prefs::kPerformanceTracingEnabled)) { |
410 const bool enabled = performance_tracing_enabled_.GetValue(); | 411 const bool enabled = performance_tracing_enabled_.GetValue(); |
411 if (enabled) | 412 if (enabled) |
412 tracing_manager_ = TracingManager::Create(); | 413 tracing_manager_ = TracingManager::Create(); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 TimeZoneResolver::kLastTimeZoneRefreshTime); | 616 TimeZoneResolver::kLastTimeZoneRefreshTime); |
616 } | 617 } |
617 } | 618 } |
618 } | 619 } |
619 } | 620 } |
620 | 621 |
621 if (pref_name == prefs::kUse24HourClock || | 622 if (pref_name == prefs::kUse24HourClock || |
622 reason != REASON_ACTIVE_USER_CHANGED) { | 623 reason != REASON_ACTIVE_USER_CHANGED) { |
623 const bool value = prefs_->GetBoolean(prefs::kUse24HourClock); | 624 const bool value = prefs_->GetBoolean(prefs::kUse24HourClock); |
624 user_manager::UserManager::Get()->SetKnownUserBooleanPref( | 625 user_manager::UserManager::Get()->SetKnownUserBooleanPref( |
625 user_->GetUserID(), prefs::kUse24HourClock, value); | 626 user_->GetAccountId(), prefs::kUse24HourClock, value); |
626 } | 627 } |
627 } | 628 } |
628 | 629 |
629 void Preferences::OnIsSyncingChanged() { | 630 void Preferences::OnIsSyncingChanged() { |
630 DVLOG(1) << "OnIsSyncingChanged"; | 631 DVLOG(1) << "OnIsSyncingChanged"; |
631 ForceNaturalScrollDefault(); | 632 ForceNaturalScrollDefault(); |
632 } | 633 } |
633 | 634 |
634 void Preferences::ForceNaturalScrollDefault() { | 635 void Preferences::ForceNaturalScrollDefault() { |
635 DVLOG(1) << "ForceNaturalScrollDefault"; | 636 DVLOG(1) << "ForceNaturalScrollDefault"; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 touch_hud_projection_enabled_.SetValue(enabled); | 711 touch_hud_projection_enabled_.SetValue(enabled); |
711 } | 712 } |
712 | 713 |
713 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { | 714 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { |
714 if (active_user != user_) | 715 if (active_user != user_) |
715 return; | 716 return; |
716 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 717 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
717 } | 718 } |
718 | 719 |
719 } // namespace chromeos | 720 } // namespace chromeos |
OLD | NEW |