OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/extensions/api/enterprise_platform_keys_private/enterpr
ise_platform_keys_private_api.h" | 5 #include "chrome/browser/extensions/api/enterprise_platform_keys_private/enterpr
ise_platform_keys_private_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 callback.Run(value); | 135 callback.Run(value); |
136 } | 136 } |
137 | 137 |
138 bool EPKPChallengeKeyBase::IsEnterpriseDevice() const { | 138 bool EPKPChallengeKeyBase::IsEnterpriseDevice() const { |
139 return install_attributes_->IsEnterpriseManaged(); | 139 return install_attributes_->IsEnterpriseManaged(); |
140 } | 140 } |
141 | 141 |
142 bool EPKPChallengeKeyBase::IsExtensionWhitelisted() const { | 142 bool EPKPChallengeKeyBase::IsExtensionWhitelisted() const { |
143 const base::ListValue* list = | 143 const base::ListValue* list = |
144 profile_->GetPrefs()->GetList(prefs::kAttestationExtensionWhitelist); | 144 profile_->GetPrefs()->GetList(prefs::kAttestationExtensionWhitelist); |
145 base::StringValue value(extension_id_); | 145 base::Value value(extension_id_); |
146 return list->Find(value) != list->end(); | 146 return list->Find(value) != list->end(); |
147 } | 147 } |
148 | 148 |
149 AccountId EPKPChallengeKeyBase::GetAccountId() const { | 149 AccountId EPKPChallengeKeyBase::GetAccountId() const { |
150 const user_manager::User* user = | 150 const user_manager::User* user = |
151 chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); | 151 chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); |
152 | 152 |
153 // Signin profile doesn't have associated user. | 153 // Signin profile doesn't have associated user. |
154 if (!user) { | 154 if (!user) { |
155 return EmptyAccountId(); | 155 return EmptyAccountId(); |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 std::string encoded_response; | 634 std::string encoded_response; |
635 base::Base64Encode(data, &encoded_response); | 635 base::Base64Encode(data, &encoded_response); |
636 Respond(ArgumentList( | 636 Respond(ArgumentList( |
637 api_epkp::ChallengeUserKey::Results::Create(encoded_response))); | 637 api_epkp::ChallengeUserKey::Results::Create(encoded_response))); |
638 } else { | 638 } else { |
639 Respond(Error(data)); | 639 Respond(Error(data)); |
640 } | 640 } |
641 } | 641 } |
642 | 642 |
643 } // namespace extensions | 643 } // namespace extensions |
OLD | NEW |