Chromium Code Reviews| 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. |