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

Unified Diff: chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.cc

Issue 473153002: Inline sign in extracts gaia id from HTTP header and seeds account tracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 2 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/ui/webui/chromeos/login/inline_login_handler_chromeos.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.cc b/chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.cc
index a3a722e92f1c0e87a7944911d2919831a487a7ef..3d0cc9e647a0f3a8211f2cdeffabbacbb3184e79 100644
--- a/chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.cc
+++ b/chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.cc
@@ -6,11 +6,13 @@
#include "chrome/browser/chromeos/login/signin/oauth2_token_fetcher.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/chrome_signin_client_factory.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/common/url_constants.h"
+#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_client.h"
#include "components/signin/core/browser/signin_manager.h"
@@ -72,10 +74,20 @@ void InlineLoginHandlerChromeOS::CompleteLogin(const base::ListValue* args) {
dict->GetString("sessionIndex", &session_index);
CHECK(!session_index.empty()) << "Session index is empty.";
- std::string account_id;
- dict->GetString("email", &account_id);
- CHECK(!account_id.empty()) << "Account ID is empty.";
+ std::string email;
+ dict->GetString("email", &email);
+ CHECK(!email.empty()) << "Email is empty.";
+ std::string gaia_id;
bartfab (slow) 2014/10/14 17:12:38 Nit: #include <string>
Roger Tawa OOO till Jul 10th 2014/10/16 02:39:32 Done.
+ dict->GetString("gaiaId", &gaia_id);
+ CHECK(!gaia_id.empty()) << "Gaia ID is empty.";
+
+ AccountTrackerService* account_tracker =
+ AccountTrackerServiceFactory::GetForProfile(profile);
+ account_tracker->SeedAccountInfo(gaia_id, email);
+
+ std::string account_id =
bartfab (slow) 2014/10/14 17:12:38 Nit: const.
Roger Tawa OOO till Jul 10th 2014/10/16 02:39:32 Done.
+ account_tracker->PickAccountIdForAccount(gaia_id, email);
oauth2_delegate_.reset(new InlineLoginUIOAuth2Delegate(web_ui(), account_id));
net::URLRequestContextGetter* request_context =
content::BrowserContext::GetStoragePartitionForSite(

Powered by Google App Engine
This is Rietveld 408576698