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

Side by Side Diff: chrome/browser/extensions/api/identity/identity_api.cc

Issue 784283006: chrome.identity API: Restrict gaia ID access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reuse identity.email, kill identity.gaiaId Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/identity_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/identity/identity_api.h" 5 #include "chrome/browser/extensions/api/identity/identity_api.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 return RespondNow(Error(identity_constants::kOffTheRecord)); 845 return RespondNow(Error(identity_constants::kOffTheRecord));
846 } 846 }
847 847
848 AccountTrackerService::AccountInfo account = 848 AccountTrackerService::AccountInfo account =
849 AccountTrackerServiceFactory::GetForProfile(GetProfile()) 849 AccountTrackerServiceFactory::GetForProfile(GetProfile())
850 ->GetAccountInfo(GetPrimaryAccountId(GetProfile())); 850 ->GetAccountInfo(GetPrimaryAccountId(GetProfile()));
851 api::identity::ProfileUserInfo profile_user_info; 851 api::identity::ProfileUserInfo profile_user_info;
852 if (extension()->permissions_data()->HasAPIPermission( 852 if (extension()->permissions_data()->HasAPIPermission(
853 APIPermission::kIdentityEmail)) { 853 APIPermission::kIdentityEmail)) {
854 profile_user_info.email = account.email; 854 profile_user_info.email = account.email;
855 profile_user_info.id = account.gaia;
855 } 856 }
856 profile_user_info.id = account.gaia;
857 857
858 return RespondNow(OneArgument(profile_user_info.ToValue().release())); 858 return RespondNow(OneArgument(profile_user_info.ToValue().release()));
859 } 859 }
860 860
861 IdentityRemoveCachedAuthTokenFunction::IdentityRemoveCachedAuthTokenFunction() { 861 IdentityRemoveCachedAuthTokenFunction::IdentityRemoveCachedAuthTokenFunction() {
862 } 862 }
863 863
864 IdentityRemoveCachedAuthTokenFunction:: 864 IdentityRemoveCachedAuthTokenFunction::
865 ~IdentityRemoveCachedAuthTokenFunction() { 865 ~IdentityRemoveCachedAuthTokenFunction() {
866 } 866 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { 953 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) {
954 SetResult(new base::StringValue(redirect_url.spec())); 954 SetResult(new base::StringValue(redirect_url.spec()));
955 SendResponse(true); 955 SendResponse(true);
956 if (auth_flow_) 956 if (auth_flow_)
957 auth_flow_.release()->DetachDelegateAndDelete(); 957 auth_flow_.release()->DetachDelegateAndDelete();
958 Release(); // Balanced in RunAsync. 958 Release(); // Balanced in RunAsync.
959 } 959 }
960 } 960 }
961 961
962 } // namespace extensions 962 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/identity_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698