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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 FOR_EACH_OBSERVER(Observer, observer_list_, OnUntrustedLoginUIShown()); | 60 FOR_EACH_OBSERVER(Observer, observer_list_, OnUntrustedLoginUIShown()); |
61 } | 61 } |
62 | 62 |
63 void LoginUIService::ShowLoginPopup() { | 63 void LoginUIService::ShowLoginPopup() { |
64 #if defined(OS_CHROMEOS) | 64 #if defined(OS_CHROMEOS) |
65 if (chrome::IsRunningInForcedAppMode()) | 65 if (chrome::IsRunningInForcedAppMode()) |
66 InlineLoginDialog::Show(profile_); | 66 InlineLoginDialog::Show(profile_); |
67 #else | 67 #else |
68 chrome::ScopedTabbedBrowserDisplayer displayer( | 68 chrome::ScopedTabbedBrowserDisplayer displayer( |
69 profile_, chrome::GetActiveDesktop()); | 69 profile_, chrome::GetActiveDesktop()); |
70 chrome::ShowBrowserSignin(displayer.browser(), signin::SOURCE_APP_LAUNCHER); | 70 chrome::ShowBrowserSignin( |
| 71 displayer.browser(), signin_metrics::SOURCE_APP_LAUNCHER); |
71 #endif | 72 #endif |
72 } | 73 } |
73 | 74 |
74 void LoginUIService::DisplayLoginResult(Browser* browser, | 75 void LoginUIService::DisplayLoginResult(Browser* browser, |
75 const base::string16& message) { | 76 const base::string16& message) { |
76 last_login_result_ = message; | 77 last_login_result_ = message; |
77 if (switches::IsNewAvatarMenu()) { | 78 if (switches::IsNewAvatarMenu()) { |
78 browser->window()->ShowAvatarBubbleFromAvatarButton( | 79 browser->window()->ShowAvatarBubbleFromAvatarButton( |
79 message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN : | 80 message.empty() ? BrowserWindow::AVATAR_BUBBLE_MODE_CONFIRM_SIGNIN : |
80 BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, | 81 BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR, |
81 signin::ManageAccountsParams()); | 82 signin::ManageAccountsParams()); |
82 } else { | 83 } else { |
83 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 84 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
84 browser->window()->ShowOneClickSigninBubble( | 85 browser->window()->ShowOneClickSigninBubble( |
85 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE, | 86 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE, |
86 base::string16(), /* no SAML email */ | 87 base::string16(), /* no SAML email */ |
87 message, | 88 message, |
88 // This callback is never invoked. | 89 // This callback is never invoked. |
89 // TODO(rogerta): Separate out the bubble API so we don't have to pass | 90 // TODO(rogerta): Separate out the bubble API so we don't have to pass |
90 // ignored |email| and |callback| params. | 91 // ignored |email| and |callback| params. |
91 BrowserWindow::StartSyncCallback()); | 92 BrowserWindow::StartSyncCallback()); |
92 #endif | 93 #endif |
93 } | 94 } |
94 } | 95 } |
95 | 96 |
96 const base::string16& LoginUIService::GetLastLoginResult() { | 97 const base::string16& LoginUIService::GetLastLoginResult() { |
97 return last_login_result_; | 98 return last_login_result_; |
98 } | 99 } |
OLD | NEW |