Chromium Code Reviews| 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" |
| 11 #include "chrome/browser/ui/browser_window.h" | 11 #include "chrome/browser/ui/browser_window.h" |
| 12 #include "chrome/browser/ui/chrome_pages.h" | 12 #include "chrome/browser/ui/chrome_pages.h" |
| 13 #include "chrome/browser/ui/profile_chooser_constants.h" | 13 #include "chrome/browser/ui/profile_chooser_constants.h" |
| 14 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 14 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 15 #include "chrome/browser/ui/user_manager.h" | |
| 15 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 16 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 16 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 17 #include "components/signin/core/browser/signin_header_helper.h" | 18 #include "components/signin/core/browser/signin_header_helper.h" |
| 18 #include "components/signin/core/common/profile_management_switches.h" | 19 #include "components/signin/core/common/profile_management_switches.h" |
| 19 | 20 |
| 20 LoginUIService::LoginUIService(Profile* profile) | 21 LoginUIService::LoginUIService(Profile* profile) |
| 21 #if !defined(OS_CHROMEOS) | 22 #if !defined(OS_CHROMEOS) |
| 22 : profile_(profile) | 23 : profile_(profile) |
| 23 #endif | 24 #endif |
| 24 { | 25 { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 void LoginUIService::DisplayLoginResult(Browser* browser, | 74 void LoginUIService::DisplayLoginResult(Browser* browser, |
| 74 const base::string16& error_message, | 75 const base::string16& error_message, |
| 75 const base::string16& email) { | 76 const base::string16& email) { |
| 76 #if defined(OS_CHROMEOS) | 77 #if defined(OS_CHROMEOS) |
| 77 // ChromeOS doesn't have the avatar bubble so it never calls this function. | 78 // ChromeOS doesn't have the avatar bubble so it never calls this function. |
| 78 NOTREACHED(); | 79 NOTREACHED(); |
| 79 #endif | 80 #endif |
| 80 last_login_result_ = error_message; | 81 last_login_result_ = error_message; |
| 81 last_login_error_email_ = email; | 82 last_login_error_email_ = email; |
| 82 if (switches::IsMaterialDesignUserMenu() && !error_message.empty()) { | 83 if (switches::IsMaterialDesignUserMenu() && !error_message.empty()) { |
| 83 browser->ShowModalSigninErrorWindow(); | 84 if (browser) |
| 84 } else { | 85 browser->ShowModalSigninErrorWindow(); |
| 86 else | |
| 87 UserManager::DisplayErrorMessage(); | |
| 88 } else if (browser) { | |
| 85 browser->window()->ShowAvatarBubbleFromAvatarButton( | 89 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 86 error_message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN | 90 error_message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN |
| 87 : BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, | 91 : BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, |
| 88 signin::ManageAccountsParams(), | 92 signin::ManageAccountsParams(), |
| 89 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); | 93 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); |
| 90 } | 94 } |
|
Roger Tawa OOO till Jul 10th
2016/11/08 15:16:11
Shouldn't there be an else block here for when bro
zmin
2016/11/08 18:39:07
Without force-sign-in, the DisplayLoginResult wil
| |
| 91 } | 95 } |
| 92 | 96 |
| 93 const base::string16& LoginUIService::GetLastLoginResult() const { | 97 const base::string16& LoginUIService::GetLastLoginResult() const { |
| 94 return last_login_result_; | 98 return last_login_result_; |
| 95 } | 99 } |
| 96 | 100 |
| 97 const base::string16& LoginUIService::GetLastLoginErrorEmail() const { | 101 const base::string16& LoginUIService::GetLastLoginErrorEmail() const { |
| 98 return last_login_error_email_; | 102 return last_login_error_email_; |
| 99 } | 103 } |
| OLD | NEW |