OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ownership/owner_settings_service_chromeos.h" | 5 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
6 | 6 |
7 #include <keyhi.h> | 7 #include <keyhi.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 714 |
715 LOG(FATAL) << "Device setting " << path << " is read-only."; | 715 LOG(FATAL) << "Device setting " << path << " is read-only."; |
716 } | 716 } |
717 } | 717 } |
718 | 718 |
719 void OwnerSettingsServiceChromeOS::OnPostKeypairLoadedActions() { | 719 void OwnerSettingsServiceChromeOS::OnPostKeypairLoadedActions() { |
720 DCHECK(thread_checker_.CalledOnValidThread()); | 720 DCHECK(thread_checker_.CalledOnValidThread()); |
721 | 721 |
722 const user_manager::User* user = | 722 const user_manager::User* user = |
723 ProfileHelper::Get()->GetUserByProfile(profile_); | 723 ProfileHelper::Get()->GetUserByProfile(profile_); |
724 user_id_ = user ? user->GetUserID() : std::string(); | 724 user_id_ = user ? user->GetAccountId().GetUserEmail() : std::string(); |
725 | 725 |
726 const bool is_owner = IsOwner() || IsOwnerInTests(user_id_); | 726 const bool is_owner = IsOwner() || IsOwnerInTests(user_id_); |
727 if (is_owner && device_settings_service_) | 727 if (is_owner && device_settings_service_) |
728 device_settings_service_->InitOwner(user_id_, weak_factory_.GetWeakPtr()); | 728 device_settings_service_->InitOwner(user_id_, weak_factory_.GetWeakPtr()); |
729 | 729 |
730 has_pending_fixups_ = true; | 730 has_pending_fixups_ = true; |
731 } | 731 } |
732 | 732 |
733 void OwnerSettingsServiceChromeOS::ReloadKeypairImpl(const base::Callback< | 733 void OwnerSettingsServiceChromeOS::ReloadKeypairImpl(const base::Callback< |
734 void(const scoped_refptr<PublicKey>& public_key, | 734 void(const scoped_refptr<PublicKey>& public_key, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 std::vector<OnManagementSettingsSetCallback> callbacks; | 814 std::vector<OnManagementSettingsSetCallback> callbacks; |
815 pending_management_settings_callbacks_.swap(callbacks); | 815 pending_management_settings_callbacks_.swap(callbacks); |
816 for (const auto& callback : callbacks) { | 816 for (const auto& callback : callbacks) { |
817 if (!callback.is_null()) | 817 if (!callback.is_null()) |
818 callback.Run(success); | 818 callback.Run(success); |
819 } | 819 } |
820 StorePendingChanges(); | 820 StorePendingChanges(); |
821 } | 821 } |
822 | 822 |
823 } // namespace chromeos | 823 } // namespace chromeos |
OLD | NEW |