| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 5 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/signin/signin_promo.h" | 9 #include "chrome/browser/signin/signin_promo.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 NOTREACHED(); | 59 NOTREACHED(); |
| 60 #else | 60 #else |
| 61 chrome::ScopedTabbedBrowserDisplayer displayer(profile_); | 61 chrome::ScopedTabbedBrowserDisplayer displayer(profile_); |
| 62 chrome::ShowBrowserSignin( | 62 chrome::ShowBrowserSignin( |
| 63 displayer.browser(), | 63 displayer.browser(), |
| 64 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); | 64 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); |
| 65 #endif | 65 #endif |
| 66 } | 66 } |
| 67 | 67 |
| 68 void LoginUIService::DisplayLoginResult(Browser* browser, | 68 void LoginUIService::DisplayLoginResult(Browser* browser, |
| 69 const base::string16& message) { | 69 const base::string16& error_message, |
| 70 const base::string16& email) { |
| 70 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
| 71 // ChromeOS doesn't have the avatar bubble so it never calls this function. | 72 // ChromeOS doesn't have the avatar bubble so it never calls this function. |
| 72 NOTREACHED(); | 73 NOTREACHED(); |
| 73 #endif | 74 #endif |
| 74 last_login_result_ = message; | 75 last_login_result_ = error_message; |
| 75 browser->window()->ShowAvatarBubbleFromAvatarButton( | 76 last_login_error_email_ = email; |
| 76 message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN | 77 if (switches::IsMaterialDesignUserMenu() && !error_message.empty()) { |
| 77 : BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, | 78 browser->ShowModalSigninErrorWindow(); |
| 78 signin::ManageAccountsParams(), | 79 } else { |
| 79 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); | 80 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 81 error_message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN |
| 82 : BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, |
| 83 signin::ManageAccountsParams(), |
| 84 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); |
| 85 } |
| 80 } | 86 } |
| 81 | 87 |
| 82 const base::string16& LoginUIService::GetLastLoginResult() const { | 88 const base::string16& LoginUIService::GetLastLoginResult() const { |
| 83 return last_login_result_; | 89 return last_login_result_; |
| 84 } | 90 } |
| 85 | 91 |
| 86 const base::string16& LoginUIService::GetLastLoginErrorEmail() const { | 92 const base::string16& LoginUIService::GetLastLoginErrorEmail() const { |
| 87 return last_login_error_email_; | 93 return last_login_error_email_; |
| 88 } | 94 } |
| OLD | NEW |