| 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 "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/signin/signin_promo.h" | 8 #include "chrome/browser/signin/signin_promo.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #else | 68 #else |
| 69 chrome::ScopedTabbedBrowserDisplayer displayer( | 69 chrome::ScopedTabbedBrowserDisplayer displayer( |
| 70 profile_, chrome::GetActiveDesktop()); | 70 profile_, chrome::GetActiveDesktop()); |
| 71 chrome::ShowBrowserSignin( | 71 chrome::ShowBrowserSignin( |
| 72 displayer.browser(), signin_metrics::SOURCE_APP_LAUNCHER); | 72 displayer.browser(), signin_metrics::SOURCE_APP_LAUNCHER); |
| 73 #endif | 73 #endif |
| 74 } | 74 } |
| 75 | 75 |
| 76 void LoginUIService::DisplayLoginResult(Browser* browser, | 76 void LoginUIService::DisplayLoginResult(Browser* browser, |
| 77 const base::string16& message) { | 77 const base::string16& message) { |
| 78 #if defined(OS_CHROMEOS) |
| 79 // ChromeOS doesn't have the avatar bubble so it never calls this function. |
| 80 NOTREACHED(); |
| 81 #endif |
| 78 last_login_result_ = message; | 82 last_login_result_ = message; |
| 79 if (switches::IsNewAvatarMenu()) { | 83 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 80 browser->window()->ShowAvatarBubbleFromAvatarButton( | 84 message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN : |
| 81 message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN : | 85 BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, |
| 82 BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, | 86 signin::ManageAccountsParams()); |
| 83 signin::ManageAccountsParams()); | |
| 84 } else { | |
| 85 #if defined(ENABLE_ONE_CLICK_SIGNIN) | |
| 86 browser->window()->ShowOneClickSigninBubble( | |
| 87 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE, | |
| 88 base::string16(), /* no SAML email */ | |
| 89 message, | |
| 90 // This callback is never invoked. | |
| 91 // TODO(rogerta): Separate out the bubble API so we don't have to pass | |
| 92 // ignored |email| and |callback| params. | |
| 93 BrowserWindow::StartSyncCallback()); | |
| 94 #endif | |
| 95 } | |
| 96 } | 87 } |
| 97 | 88 |
| 98 const base::string16& LoginUIService::GetLastLoginResult() { | 89 const base::string16& LoginUIService::GetLastLoginResult() { |
| 99 return last_login_result_; | 90 return last_login_result_; |
| 100 } | 91 } |
| OLD | NEW |