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

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

Issue 13979003: Win: Display a native bubble (instead of the JS one) after the web signin flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed/reenabled browser tests (hopefully) Created 7 years, 8 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/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 d215d824594d2622d005cd5ef6d344eeda8efca8..78b0db307922c61dc1c750102454f5804de78910 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -525,7 +525,8 @@ bool OneClickInfoBarDelegateImpl::Accept() {
StartSyncArgs(profile, browser,
OneClickSigninHelper::AUTO_ACCEPT_NONE,
session_index_, email_, password_,
- false /* force_same_tab_navigation */)));
+ false /* force_same_tab_navigation */)),
+ "" /* no error message to display */);
button_pressed_ = true;
return true;
}
@@ -978,11 +979,7 @@ void OneClickSigninHelper::RedirectToNtpOrAppsPage(bool show_bubble) {
content::WebContents* contents = web_contents();
Profile* profile =
Profile::FromBrowserContext(contents->GetBrowserContext());
- PrefService* pref_service = profile->GetPrefs();
- if (show_bubble) {
- pref_service->SetBoolean(prefs::kSyncPromoShowNTPBubble, true);
- pref_service->SetString(prefs::kSyncPromoErrorMessage, error_message_);
- }
+ Browser* browser = chrome::FindBrowserWithWebContents(contents);
GURL url(chrome::IsInstantExtendedAPIEnabled() ?
chrome::kChromeUIAppsURL : chrome::kChromeUINewTabURL);
@@ -993,6 +990,17 @@ void OneClickSigninHelper::RedirectToNtpOrAppsPage(bool show_bubble) {
false);
contents->OpenURL(params);
+ if (show_bubble) {
+ browser->window()->ShowOneClickSigninBubble(
+ BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE,
+ string16(), /* no SAML email */
+ base::Bind(&StartSync,
+ StartSyncArgs(profile, browser, AUTO_ACCEPT_ACCEPTED,
+ session_index_, email_, password_,
+ false)),
+ error_message_);
+ }
+
error_message_.clear();
}
@@ -1233,7 +1241,8 @@ void OneClickSigninHelper::DidStopLoading(
base::Bind(&StartSync,
StartSyncArgs(profile, browser, auto_accept_,
session_index_, email_, password_,
- false /* force_same_tab_navigation */)));
+ false /* force_same_tab_navigation */)),
+ error_message_);
break;
case AUTO_ACCEPT_CONFIGURE:
LogOneClickHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED);
@@ -1271,7 +1280,8 @@ void OneClickSigninHelper::DidStopLoading(
base::Bind(&StartSync,
StartSyncArgs(profile, browser, auto_accept_,
session_index_, email_, password_,
- force_same_tab_navigation)));
+ force_same_tab_navigation)),
+ "" /* no error message to display */);
} else if (!last_email.empty() && last_email != email_) {
// If the new email address is different from the email address that
// just signed in, show a confirmation dialog.

Powered by Google App Engine
This is Rietveld 408576698