| Index: chrome/browser/chromeos/extensions/users_private/users_private_api.cc
|
| diff --git a/chrome/browser/chromeos/extensions/users_private/users_private_api.cc b/chrome/browser/chromeos/extensions/users_private/users_private_api.cc
|
| index 0ca0a1bde918c3cbf7309ae52446f9f726765c3d..4c7267cf2a4ae43b5dc12ed326f396dbab6cc4cd 100644
|
| --- a/chrome/browser/chromeos/extensions/users_private/users_private_api.cc
|
| +++ b/chrome/browser/chromeos/extensions/users_private/users_private_api.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include <utility>
|
|
|
| +#include "base/bind.h"
|
| #include "base/memory/ptr_util.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/values.h"
|
| @@ -23,6 +24,7 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/common/extensions/api/users_private.h"
|
| #include "chromeos/settings/cros_settings_names.h"
|
| +#include "components/ownership/owner_settings_service.h"
|
| #include "components/user_manager/user_manager.h"
|
| #include "components/user_manager/user_names.h"
|
| #include "extensions/browser/extension_function_registry.h"
|
| @@ -211,9 +213,15 @@ UsersPrivateIsCurrentUserOwnerFunction::
|
|
|
| ExtensionFunction::ResponseAction
|
| UsersPrivateIsCurrentUserOwnerFunction::Run() {
|
| - bool is_owner =
|
| - chromeos::ProfileHelper::IsOwnerProfile(chrome_details_.GetProfile());
|
| - return RespondNow(OneArgument(base::MakeUnique<base::Value>(is_owner)));
|
| + chromeos::OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(
|
| + browser_context())
|
| + ->IsOwnerAsync(base::Bind(
|
| + &UsersPrivateIsCurrentUserOwnerFunction::IsOwnerCallback, this));
|
| + return RespondLater();
|
| +}
|
| +
|
| +void UsersPrivateIsCurrentUserOwnerFunction::IsOwnerCallback(bool is_owner) {
|
| + Respond(OneArgument(base::MakeUnique<base::Value>(is_owner)));
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
|
|