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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 } | 393 } |
394 | 394 |
395 void Preferences::OnPreferenceChanged(const std::string& pref_name) { | 395 void Preferences::OnPreferenceChanged(const std::string& pref_name) { |
396 ApplyPreferences(REASON_PREF_CHANGED, pref_name); | 396 ApplyPreferences(REASON_PREF_CHANGED, pref_name); |
397 } | 397 } |
398 | 398 |
399 void Preferences::ApplyPreferences(ApplyReason reason, | 399 void Preferences::ApplyPreferences(ApplyReason reason, |
400 const std::string& pref_name) { | 400 const std::string& pref_name) { |
401 DCHECK(reason != REASON_PREF_CHANGED || !pref_name.empty()); | 401 DCHECK(reason != REASON_PREF_CHANGED || !pref_name.empty()); |
402 const bool user_is_owner = | 402 const bool user_is_owner = |
403 user_manager::UserManager::Get()->GetOwnerEmail() == user_->email(); | 403 user_manager::UserManager::Get()->GetOwnerAccountId() == |
| 404 user_->GetAccountId(); |
404 const bool user_is_active = user_->is_active(); | 405 const bool user_is_active = user_->is_active(); |
405 | 406 |
406 system::TouchpadSettings touchpad_settings; | 407 system::TouchpadSettings touchpad_settings; |
407 system::MouseSettings mouse_settings; | 408 system::MouseSettings mouse_settings; |
408 | 409 |
409 if (user_is_primary_ && (reason == REASON_INITIALIZATION || | 410 if (user_is_primary_ && (reason == REASON_INITIALIZATION || |
410 pref_name == prefs::kPerformanceTracingEnabled)) { | 411 pref_name == prefs::kPerformanceTracingEnabled)) { |
411 const bool enabled = performance_tracing_enabled_.GetValue(); | 412 const bool enabled = performance_tracing_enabled_.GetValue(); |
412 if (enabled) | 413 if (enabled) |
413 tracing_manager_ = TracingManager::Create(); | 414 tracing_manager_ = TracingManager::Create(); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 TimeZoneResolver::kLastTimeZoneRefreshTime); | 619 TimeZoneResolver::kLastTimeZoneRefreshTime); |
619 } | 620 } |
620 } | 621 } |
621 } | 622 } |
622 } | 623 } |
623 | 624 |
624 if (pref_name == prefs::kUse24HourClock || | 625 if (pref_name == prefs::kUse24HourClock || |
625 reason != REASON_ACTIVE_USER_CHANGED) { | 626 reason != REASON_ACTIVE_USER_CHANGED) { |
626 const bool value = prefs_->GetBoolean(prefs::kUse24HourClock); | 627 const bool value = prefs_->GetBoolean(prefs::kUse24HourClock); |
627 user_manager::UserManager::Get()->SetKnownUserBooleanPref( | 628 user_manager::UserManager::Get()->SetKnownUserBooleanPref( |
628 user_->GetUserID(), prefs::kUse24HourClock, value); | 629 user_->GetAccountId(), prefs::kUse24HourClock, value); |
629 } | 630 } |
630 } | 631 } |
631 | 632 |
632 void Preferences::OnIsSyncingChanged() { | 633 void Preferences::OnIsSyncingChanged() { |
633 DVLOG(1) << "OnIsSyncingChanged"; | 634 DVLOG(1) << "OnIsSyncingChanged"; |
634 ForceNaturalScrollDefault(); | 635 ForceNaturalScrollDefault(); |
635 } | 636 } |
636 | 637 |
637 void Preferences::ForceNaturalScrollDefault() { | 638 void Preferences::ForceNaturalScrollDefault() { |
638 DVLOG(1) << "ForceNaturalScrollDefault"; | 639 DVLOG(1) << "ForceNaturalScrollDefault"; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 touch_hud_projection_enabled_.SetValue(enabled); | 714 touch_hud_projection_enabled_.SetValue(enabled); |
714 } | 715 } |
715 | 716 |
716 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { | 717 void Preferences::ActiveUserChanged(const user_manager::User* active_user) { |
717 if (active_user != user_) | 718 if (active_user != user_) |
718 return; | 719 return; |
719 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); | 720 ApplyPreferences(REASON_ACTIVE_USER_CHANGED, ""); |
720 } | 721 } |
721 | 722 |
722 } // namespace chromeos | 723 } // namespace chromeos |
OLD | NEW |