OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/users_private/users_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/users_private/users_private_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 // Now populate the list of User objects for returning to the JS. | 98 // Now populate the list of User objects for returning to the JS. |
99 for (size_t i = 0; i < email_list->GetSize(); ++i) { | 99 for (size_t i = 0; i < email_list->GetSize(); ++i) { |
100 api::users_private::User user; | 100 api::users_private::User user; |
101 email_list->GetString(i, &user.email); | 101 email_list->GetString(i, &user.email); |
102 user.name = | 102 user.name = |
103 user_manager->GetUserDisplayEmail(AccountId::FromUserEmail(user.email)); | 103 user_manager->GetUserDisplayEmail(AccountId::FromUserEmail(user.email)); |
104 user.is_owner = chromeos::ProfileHelper::IsOwnerProfile(profile) && | 104 user.is_owner = chromeos::ProfileHelper::IsOwnerProfile(profile) && |
105 user.email == profile->GetProfileUserName(); | 105 user.email == profile->GetProfileUserName(); |
106 user_list->Append(user.ToValue().release()); | 106 user_list->Append(user.ToValue()); |
107 } | 107 } |
108 | 108 |
109 return RespondNow(OneArgument(std::move(user_list))); | 109 return RespondNow(OneArgument(std::move(user_list))); |
110 } | 110 } |
111 | 111 |
112 //////////////////////////////////////////////////////////////////////////////// | 112 //////////////////////////////////////////////////////////////////////////////// |
113 // UsersPrivateAddWhitelistedUserFunction | 113 // UsersPrivateAddWhitelistedUserFunction |
114 | 114 |
115 UsersPrivateAddWhitelistedUserFunction::UsersPrivateAddWhitelistedUserFunction() | 115 UsersPrivateAddWhitelistedUserFunction::UsersPrivateAddWhitelistedUserFunction() |
116 : chrome_details_(this) { | 116 : chrome_details_(this) { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 ExtensionFunction::ResponseAction | 221 ExtensionFunction::ResponseAction |
222 UsersPrivateIsWhitelistManagedFunction::Run() { | 222 UsersPrivateIsWhitelistManagedFunction::Run() { |
223 bool is_managed = g_browser_process->platform_part() | 223 bool is_managed = g_browser_process->platform_part() |
224 ->browser_policy_connector_chromeos() | 224 ->browser_policy_connector_chromeos() |
225 ->IsEnterpriseManaged(); | 225 ->IsEnterpriseManaged(); |
226 return RespondNow( | 226 return RespondNow( |
227 OneArgument(base::MakeUnique<base::FundamentalValue>(is_managed))); | 227 OneArgument(base::MakeUnique<base::FundamentalValue>(is_managed))); |
228 } | 228 } |
229 | 229 |
230 } // namespace extensions | 230 } // namespace extensions |
OLD | NEW |