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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retriever.cc

Issue 166433005: Add URL parameter so that /ListAccounts returns valid json. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chromeos compile error Created 6 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h" 5 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "google_apis/gaia/gaia_auth_util.h" 9 #include "google_apis/gaia/gaia_auth_util.h"
10 #include "google_apis/gaia/gaia_constants.h" 10 #include "google_apis/gaia/gaia_constants.h"
(...skipping 10 matching lines...) Expand all
21 GaiaConstants::kChromeSource, 21 GaiaConstants::kChromeSource,
22 url_request_context_getter) { 22 url_request_context_getter) {
23 gaia_auth_fetcher_.StartListAccounts(); 23 gaia_auth_fetcher_.StartListAccounts();
24 } 24 }
25 25
26 AuthenticatedUserEmailRetriever::~AuthenticatedUserEmailRetriever() { 26 AuthenticatedUserEmailRetriever::~AuthenticatedUserEmailRetriever() {
27 } 27 }
28 28
29 void AuthenticatedUserEmailRetriever::OnListAccountsSuccess( 29 void AuthenticatedUserEmailRetriever::OnListAccountsSuccess(
30 const std::string& data) { 30 const std::string& data) {
31 std::vector<std::string> accounts; 31 std::vector<std::pair<std::string, bool> > accounts;
bartfab (slow) 2014/02/17 15:22:04 Nit: #include <utility>
Roger Tawa OOO till Jul 10th 2014/02/18 19:37:54 Done.
32 gaia::ParseListAccountsData(data, &accounts); 32 gaia::ParseListAccountsData(data, &accounts);
33 if (accounts.size() != 1) 33 if (accounts.size() != 1)
34 callback_.Run(std::string()); 34 callback_.Run(std::string());
35 else 35 else
36 callback_.Run(accounts.front()); 36 callback_.Run(accounts.front().first);
37 } 37 }
38 38
39 void AuthenticatedUserEmailRetriever::OnListAccountsFailure( 39 void AuthenticatedUserEmailRetriever::OnListAccountsFailure(
40 const GoogleServiceAuthError& error) { 40 const GoogleServiceAuthError& error) {
41 callback_.Run(std::string()); 41 callback_.Run(std::string());
42 } 42 }
43 43
44 } // namespace chromeos 44 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698