| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 void LoginUIService::UntrustedLoginUIShown() { | 56 void LoginUIService::UntrustedLoginUIShown() { |
| 57 FOR_EACH_OBSERVER(Observer, observer_list_, OnUntrustedLoginUIShown()); | 57 FOR_EACH_OBSERVER(Observer, observer_list_, OnUntrustedLoginUIShown()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void LoginUIService::ShowLoginPopup() { | 60 void LoginUIService::ShowLoginPopup() { |
| 61 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 62 NOTREACHED(); | 62 NOTREACHED(); |
| 63 #else | 63 #else |
| 64 chrome::ScopedTabbedBrowserDisplayer displayer( | 64 chrome::ScopedTabbedBrowserDisplayer displayer(profile_); |
| 65 profile_, chrome::GetActiveDesktop()); | |
| 66 chrome::ShowBrowserSignin( | 65 chrome::ShowBrowserSignin( |
| 67 displayer.browser(), | 66 displayer.browser(), |
| 68 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); | 67 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); |
| 69 #endif | 68 #endif |
| 70 } | 69 } |
| 71 | 70 |
| 72 void LoginUIService::DisplayLoginResult(Browser* browser, | 71 void LoginUIService::DisplayLoginResult(Browser* browser, |
| 73 const base::string16& message) { | 72 const base::string16& message) { |
| 74 #if defined(OS_CHROMEOS) | 73 #if defined(OS_CHROMEOS) |
| 75 // ChromeOS doesn't have the avatar bubble so it never calls this function. | 74 // ChromeOS doesn't have the avatar bubble so it never calls this function. |
| 76 NOTREACHED(); | 75 NOTREACHED(); |
| 77 #endif | 76 #endif |
| 78 last_login_result_ = message; | 77 last_login_result_ = message; |
| 79 browser->window()->ShowAvatarBubbleFromAvatarButton( | 78 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 80 message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN | 79 message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN |
| 81 : BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, | 80 : BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, |
| 82 signin::ManageAccountsParams(), | 81 signin::ManageAccountsParams(), |
| 83 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); | 82 signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS); |
| 84 } | 83 } |
| 85 | 84 |
| 86 const base::string16& LoginUIService::GetLastLoginResult() { | 85 const base::string16& LoginUIService::GetLastLoginResult() { |
| 87 return last_login_result_; | 86 return last_login_result_; |
| 88 } | 87 } |
| OLD | NEW |