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

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

Issue 485073002: Migrate signin error messages to the new avatar bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adds mac implementation Created 6 years, 4 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 d02036667cbad7b9df1873ccfe99b59b1588301a..78ff0b9e58bbb5e0665a65e133f6affa8217e0a2 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -54,6 +54,7 @@
#include "chrome/browser/ui/tab_modal_confirm_dialog.h"
#include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/net/url_util.h"
#include "chrome/common/pref_names.h"
@@ -644,12 +645,8 @@ void OneClickSigninHelper::SyncStarterWrapper::DisplayErrorBubble(
const std::string& error_message) {
args_.browser = OneClickSigninSyncStarter::EnsureBrowser(
args_.browser, args_.profile, desktop_type_);
- args_.browser->window()->ShowOneClickSigninBubble(
- BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE,
- base::string16(), // No email required - this is not a SAML confirmation.
- base::UTF8ToUTF16(error_message),
- // Callback is ignored.
- BrowserWindow::StartSyncCallback());
+ LoginUIServiceFactory::GetForProfile(args_.profile)->DisplayLoginResult(
+ args_.browser, base::UTF8ToUTF16(error_message));
}
void OneClickSigninHelper::SyncStarterWrapper::StartSigninOAuthHelper() {
@@ -1145,21 +1142,6 @@ void OneClickSigninHelper::RemoveSigninRedirectURLHistoryItem(
}
// static
-void OneClickSigninHelper::ShowSigninErrorBubble(Browser* browser,
- const std::string& error) {
- DCHECK(!error.empty());
-
- browser->window()->ShowOneClickSigninBubble(
- BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE,
- base::string16(), /* no SAML email */
- base::UTF8ToUTF16(error),
- // This callback is never invoked.
- // TODO(rogerta): Separate out the bubble API so we don't have to pass
- // ignored |email| and |callback| params.
- BrowserWindow::StartSyncCallback());
-}
-
-// static
bool OneClickSigninHelper::HandleCrossAccountError(
Profile* profile,
const std::string& session_index,
@@ -1372,7 +1354,8 @@ void OneClickSigninHelper::DidStopLoading(
// Redirect to the landing page and display an error popup.
RedirectToNtpOrAppsPage(web_contents(), source_);
- ShowSigninErrorBubble(browser, error_message_);
+ LoginUIServiceFactory::GetForProfile(profile)->
+ DisplayLoginResult(browser, base::UTF8ToUTF16(error_message_));
CleanTransientState();
return;
}

Powered by Google App Engine
This is Rietveld 408576698