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

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

Issue 291043002: identity.getAccounts should return one array instead of multiple AccountInfos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 base::ListValue* infos = new base::ListValue(); 269 base::ListValue* infos = new base::ListValue();
270 270
271 for (std::vector<std::string>::const_iterator it = gaia_ids.begin(); 271 for (std::vector<std::string>::const_iterator it = gaia_ids.begin();
272 it != gaia_ids.end(); 272 it != gaia_ids.end();
273 ++it) { 273 ++it) {
274 api::identity::AccountInfo account_info; 274 api::identity::AccountInfo account_info;
275 account_info.id = *it; 275 account_info.id = *it;
276 infos->Append(account_info.ToValue().release()); 276 infos->Append(account_info.ToValue().release());
277 } 277 }
278 278
279 return RespondNow(MultipleArguments(infos)); 279 return RespondNow(SingleArgument(infos));
280 } 280 }
281 281
282 IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction() 282 IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction()
283 : OAuth2TokenService::Consumer("extensions_identity_api"), 283 : OAuth2TokenService::Consumer("extensions_identity_api"),
284 should_prompt_for_scopes_(false), 284 should_prompt_for_scopes_(false),
285 should_prompt_for_signin_(false) {} 285 should_prompt_for_signin_(false) {}
286 286
287 IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() {} 287 IdentityGetAuthTokenFunction::~IdentityGetAuthTokenFunction() {}
288 288
289 bool IdentityGetAuthTokenFunction::RunAsync() { 289 bool IdentityGetAuthTokenFunction::RunAsync() {
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( 829 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange(
830 const GURL& redirect_url) { 830 const GURL& redirect_url) {
831 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { 831 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) {
832 SetResult(new base::StringValue(redirect_url.spec())); 832 SetResult(new base::StringValue(redirect_url.spec()));
833 SendResponse(true); 833 SendResponse(true);
834 Release(); // Balanced in RunAsync. 834 Release(); // Balanced in RunAsync.
835 } 835 }
836 } 836 }
837 837
838 } // namespace extensions 838 } // 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