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

Unified Diff: chrome/browser/ui/sync/one_click_signin_helper.cc

Issue 362613002: Implementation of SigninClient::GetSigninScopedDeviceId (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes after feedback from Roger. 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
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_helper.h ('k') | components/signin/core/browser/signin_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_helper.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index 6962977fb3d9eefb1aa2013765182496b48857d7..f1ae4aad6a1dad8e123286c933dc46f838e52c7f 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -414,7 +414,7 @@ bool AreWeShowingSignin(GURL url, signin::Source source, std::string email) {
!email.empty());
}
-// Gets signin scoped device id from signin client if profile is valid.
+// If profile is valid then get signin scoped device id from signin client.
// Otherwise returns empty string.
std::string GetSigninScopedDeviceId(Profile* profile) {
std::string signin_scoped_device_id;
@@ -516,7 +516,6 @@ OneClickSigninHelper::StartSyncArgs::StartSyncArgs(
const std::string& email,
const std::string& password,
const std::string& refresh_token,
- const std::string& signin_scoped_device_id,
content::WebContents* web_contents,
bool untrusted_confirmation_required,
signin::Source source,
@@ -528,7 +527,6 @@ OneClickSigninHelper::StartSyncArgs::StartSyncArgs(
email(email),
password(password),
refresh_token(refresh_token),
- signin_scoped_device_id(signin_scoped_device_id),
web_contents(web_contents),
source(source),
callback(callback) {
@@ -661,10 +659,11 @@ void OneClickSigninHelper::SyncStarterWrapper::DisplayErrorBubble(
}
void OneClickSigninHelper::SyncStarterWrapper::StartSigninOAuthHelper() {
+ std::string signin_scoped_device_id = GetSigninScopedDeviceId(args_.profile);
signin_oauth_helper_.reset(
new SigninOAuthHelper(args_.profile->GetRequestContext(),
args_.session_index,
- args_.signin_scoped_device_id,
+ signin_scoped_device_id,
this));
}
@@ -1181,7 +1180,6 @@ bool OneClickSigninHelper::HandleCrossAccountError(
Profile::FromBrowserContext(contents->GetBrowserContext());
std::string last_email =
profile->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername);
- std::string signin_scoped_device_id = GetSigninScopedDeviceId(profile);
if (!last_email.empty() && !gaia::AreEmailsSame(last_email, email)) {
// If the new email address is different from the email address that
@@ -1200,7 +1198,7 @@ bool OneClickSigninHelper::HandleCrossAccountError(
&StartExplicitSync,
StartSyncArgs(profile, browser, auto_accept,
session_index, email, password,
- refresh_token, signin_scoped_device_id,
+ refresh_token,
contents, false /* confirmation_required */, source,
sync_callback),
contents,
@@ -1487,7 +1485,6 @@ void OneClickSigninHelper::DidStopLoading(
<< " auto_accept=" << auto_accept_
<< " source=" << source_;
- std::string signin_scoped_device_id = GetSigninScopedDeviceId(profile);
switch (auto_accept_) {
case AUTO_ACCEPT_NONE:
if (showing_signin_)
@@ -1502,8 +1499,7 @@ void OneClickSigninHelper::DidStopLoading(
if (!do_not_start_sync_for_testing_) {
StartSync(
StartSyncArgs(profile, browser, auto_accept_,
- session_index_, email_, password_,
- "", signin_scoped_device_id,
+ session_index_, email_, password_, "",
NULL /* don't force sync setup in same tab */,
true /* confirmation_required */, source_,
CreateSyncStarterCallback()),
@@ -1519,8 +1515,7 @@ void OneClickSigninHelper::DidStopLoading(
if (!do_not_start_sync_for_testing_) {
StartSync(
StartSyncArgs(profile, browser, auto_accept_,
- session_index_, email_, password_,
- "", signin_scoped_device_id,
+ session_index_, email_, password_, "",
NULL /* don't force sync setup in same tab */,
true /* confirmation_required */, source_,
CreateSyncStarterCallback()),
@@ -1566,8 +1561,7 @@ void OneClickSigninHelper::DidStopLoading(
if (!do_not_start_sync_for_testing_) {
StartSync(
StartSyncArgs(profile, browser, auto_accept_,
- session_index_, email_, password_,
- "", signin_scoped_device_id,
+ session_index_, email_, password_, "",
contents,
untrusted_confirmation_required_, source_,
CreateSyncStarterCallback()),
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_helper.h ('k') | components/signin/core/browser/signin_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698