Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5847)

Unified Diff: chrome/browser/extensions/api/identity/identity_api.cc

Issue 327403003: Identity API: add chrome.identity.getProfileUserInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add identity.email permission to stubs_app Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 3b9ba354af618a1f76338ee8930bddf2b1cce099..64e788c07b65f2d8877b10c2676f347eb265991f 100644
--- a/chrome/browser/extensions/api/identity/identity_api.cc
+++ b/chrome/browser/extensions/api/identity/identity_api.cc
@@ -764,6 +764,26 @@ std::string IdentityGetAuthTokenFunction::GetOAuth2ClientId() const {
return client_id;
}
+IdentityGetProfileUserInfoFunction::IdentityGetProfileUserInfoFunction() {
+}
+
+IdentityGetProfileUserInfoFunction::~IdentityGetProfileUserInfoFunction() {
+}
+
+ExtensionFunction::ResponseAction IdentityGetProfileUserInfoFunction::Run() {
+ if (GetProfile()->IsOffTheRecord()) {
+ return RespondNow(Error(identity_constants::kOffTheRecord));
+ }
+
+ api::identity::ProfileUserInfo profile_user_info;
+ profile_user_info.email =
+ GetProfile()->GetPrefs()->GetString(prefs::kGoogleServicesUsername);
+ profile_user_info.id =
+ GetProfile()->GetPrefs()->GetString(prefs::kGoogleServicesUserAccountId);
+
+ return RespondNow(OneArgument(profile_user_info.ToValue().release()));
+}
+
IdentityRemoveCachedAuthTokenFunction::IdentityRemoveCachedAuthTokenFunction() {
}
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_api.h ('k') | chrome/browser/extensions/api/identity/identity_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698