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 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 bool IsOwnerInTests(const std::string& user_id) { | 55 bool IsOwnerInTests(const std::string& user_id) { |
56 if (user_id.empty() || | 56 if (user_id.empty() || |
57 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 57 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
58 ::switches::kTestType) || | 58 ::switches::kTestType) || |
59 !CrosSettings::IsInitialized()) { | 59 !CrosSettings::IsInitialized()) { |
60 return false; | 60 return false; |
61 } | 61 } |
62 const base::Value* value = CrosSettings::Get()->GetPref(kDeviceOwner); | 62 const base::Value* value = CrosSettings::Get()->GetPref(kDeviceOwner); |
63 if (!value || value->GetType() != base::Value::Type::STRING) | 63 if (!value || value->GetType() != base::Value::Type::STRING) |
64 return false; | 64 return false; |
65 return static_cast<const base::StringValue*>(value)->GetString() == user_id; | 65 return static_cast<const base::Value*>(value)->GetString() == user_id; |
66 } | 66 } |
67 | 67 |
68 void LoadPrivateKeyByPublicKey( | 68 void LoadPrivateKeyByPublicKey( |
69 const scoped_refptr<OwnerKeyUtil>& owner_key_util, | 69 const scoped_refptr<OwnerKeyUtil>& owner_key_util, |
70 scoped_refptr<PublicKey> public_key, | 70 scoped_refptr<PublicKey> public_key, |
71 const std::string& username_hash, | 71 const std::string& username_hash, |
72 const base::Callback<void(const scoped_refptr<PublicKey>& public_key, | 72 const base::Callback<void(const scoped_refptr<PublicKey>& public_key, |
73 const scoped_refptr<PrivateKey>& private_key)>& | 73 const scoped_refptr<PrivateKey>& private_key)>& |
74 callback) { | 74 callback) { |
75 crypto::EnsureNSSInit(); | 75 crypto::EnsureNSSInit(); |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 | 729 |
730 void OwnerSettingsServiceChromeOS::ReportStatusAndContinueStoring( | 730 void OwnerSettingsServiceChromeOS::ReportStatusAndContinueStoring( |
731 bool success) { | 731 bool success) { |
732 store_settings_factory_.InvalidateWeakPtrs(); | 732 store_settings_factory_.InvalidateWeakPtrs(); |
733 for (auto& observer : observers_) | 733 for (auto& observer : observers_) |
734 observer.OnSignedPolicyStored(success); | 734 observer.OnSignedPolicyStored(success); |
735 StorePendingChanges(); | 735 StorePendingChanges(); |
736 } | 736 } |
737 | 737 |
738 } // namespace chromeos | 738 } // namespace chromeos |
OLD | NEW |