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

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: std::string -> string16 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..926daa87656f2af61391440997009adcd22c59a5 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -521,6 +521,7 @@ bool OneClickInfoBarDelegateImpl::Accept() {
ShowOneClickSigninBubble(
BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE,
UTF8ToUTF16(email_),
+ string16() /* no error message to display */,
base::Bind(&StartSync,
StartSyncArgs(profile, browser,
OneClickSigninHelper::AUTO_ACCEPT_NONE,
@@ -937,6 +938,7 @@ void OneClickSigninHelper::ShowInfoBarUIThread(
(auto_accept != AUTO_ACCEPT_EXPLICIT &&
helper->auto_accept_ != AUTO_ACCEPT_EXPLICIT) ?
CAN_OFFER_FOR_INTERSTITAL_ONLY : CAN_OFFER_FOR_ALL;
+
std::string error_message;
if (!web_contents || !CanOffer(web_contents, can_offer_for, email,
@@ -978,11 +980,6 @@ 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_);
- }
GURL url(chrome::IsInstantExtendedAPIEnabled() ?
chrome::kChromeUIAppsURL : chrome::kChromeUINewTabURL);
@@ -993,6 +990,18 @@ void OneClickSigninHelper::RedirectToNtpOrAppsPage(bool show_bubble) {
false);
contents->OpenURL(params);
+ if (show_bubble) {
+ Browser* browser = chrome::FindBrowserWithWebContents(contents);
+ browser->window()->ShowOneClickSigninBubble(
+ BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE,
+ string16(), /* no SAML email */
+ UTF8ToUTF16(error_message_),
+ base::Bind(&StartSync,
+ StartSyncArgs(profile, browser, AUTO_ACCEPT_ACCEPTED,
+ session_index_, email_, password_,
+ false)));
+ }
+
error_message_.clear();
}
@@ -1230,6 +1239,7 @@ void OneClickSigninHelper::DidStopLoading(
browser->window()->ShowOneClickSigninBubble(
bubble_type,
UTF8ToUTF16(email_),
+ string16(), /* no error message to display */
base::Bind(&StartSync,
StartSyncArgs(profile, browser, auto_accept_,
session_index_, email_, password_,
@@ -1268,6 +1278,7 @@ void OneClickSigninHelper::DidStopLoading(
browser->window()->ShowOneClickSigninBubble(
BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG,
UTF8ToUTF16(email_),
+ string16(), /* no error message to display */
base::Bind(&StartSync,
StartSyncArgs(profile, browser, auto_accept_,
session_index_, email_, password_,
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.cc ('k') | chrome/browser/ui/sync/one_click_signin_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698