| Index: chrome/browser/extensions/api/identity/identity_api.cc
|
| diff --git a/chrome/browser/extensions/api/identity/identity_api.cc b/chrome/browser/extensions/api/identity/identity_api.cc
|
| index 79a66f31f1bc5156c30b579cfe81c6ecc7829a23..aea33c62065be1b7f9c15f3c2552eb455e121c3d 100644
|
| --- a/chrome/browser/extensions/api/identity/identity_api.cc
|
| +++ b/chrome/browser/extensions/api/identity/identity_api.cc
|
| @@ -31,6 +31,8 @@
|
| #include "extensions/browser/event_router.h"
|
| #include "extensions/browser/extension_function_dispatcher.h"
|
| #include "extensions/common/extension.h"
|
| +#include "extensions/common/permissions/permission_set.h"
|
| +#include "extensions/common/permissions/permissions_data.h"
|
| #include "google_apis/gaia/gaia_urls.h"
|
| #include "url/gurl.h"
|
|
|
| @@ -774,8 +776,11 @@ ExtensionFunction::ResponseAction IdentityGetProfileUserInfoFunction::Run() {
|
| }
|
|
|
| api::identity::ProfileUserInfo profile_user_info;
|
| - profile_user_info.email =
|
| - GetProfile()->GetPrefs()->GetString(prefs::kGoogleServicesUsername);
|
| + if (GetExtension()->permissions_data()->HasAPIPermission(
|
| + APIPermission::kIdentityEmail)) {
|
| + profile_user_info.email =
|
| + GetProfile()->GetPrefs()->GetString(prefs::kGoogleServicesUsername);
|
| + }
|
| profile_user_info.id =
|
| GetProfile()->GetPrefs()->GetString(prefs::kGoogleServicesUserAccountId);
|
|
|
|
|