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

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: Lint + review fixes 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..b4cdd3ae27c2e1f3cadad70d6a2adef6fc90ac0c 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 */)),
+ std::string() /* 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);
Roger Tawa OOO till Jul 10th 2013/04/17 17:53:25 Move the var declaration closer to where its used
noms (inactive) 2013/04/17 20:32:37 Done.
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_);
Roger Tawa OOO till Jul 10th 2013/04/17 17:53:25 why not std::string() like line 1284 below? Will
noms (inactive) 2013/04/17 20:32:37 Done.
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)),
+ std::string() /* 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