OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/inline_login_handler_impl.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // still navigating to it. See crbug/346632. | 90 // still navigating to it. See crbug/346632. |
91 if (contents->GetController().GetPendingEntry()) | 91 if (contents->GetController().GetPendingEntry()) |
92 return; | 92 return; |
93 | 93 |
94 VLOG(1) << "RedirectToNtpOrAppsPage"; | 94 VLOG(1) << "RedirectToNtpOrAppsPage"; |
95 // Redirect to NTP/Apps page and display a confirmation bubble | 95 // Redirect to NTP/Apps page and display a confirmation bubble |
96 GURL url(access_point == | 96 GURL url(access_point == |
97 signin_metrics::AccessPoint::ACCESS_POINT_APPS_PAGE_LINK | 97 signin_metrics::AccessPoint::ACCESS_POINT_APPS_PAGE_LINK |
98 ? chrome::kChromeUIAppsURL | 98 ? chrome::kChromeUIAppsURL |
99 : chrome::kChromeUINewTabURL); | 99 : chrome::kChromeUINewTabURL); |
100 content::OpenURLParams params(url, | 100 content::OpenURLParams params(url, content::Referrer(), |
101 content::Referrer(), | 101 WindowOpenDisposition::CURRENT_TAB, |
102 CURRENT_TAB, | 102 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false); |
103 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | |
104 false); | |
105 contents->OpenURL(params); | 103 contents->OpenURL(params); |
106 } | 104 } |
107 | 105 |
108 void RedirectToNtpOrAppsPageIfNecessary( | 106 void RedirectToNtpOrAppsPageIfNecessary( |
109 content::WebContents* contents, | 107 content::WebContents* contents, |
110 signin_metrics::AccessPoint access_point) { | 108 signin_metrics::AccessPoint access_point) { |
111 if (access_point != signin_metrics::AccessPoint::ACCESS_POINT_SETTINGS) | 109 if (access_point != signin_metrics::AccessPoint::ACCESS_POINT_SETTINGS) |
112 RedirectToNtpOrAppsPage(contents, access_point); | 110 RedirectToNtpOrAppsPage(contents, access_point); |
113 } | 111 } |
114 | 112 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 base::ResetAndReturn(&callback_).Run(InlineSigninHelper::START_SYNC); | 210 base::ResetAndReturn(&callback_).Run(InlineSigninHelper::START_SYNC); |
213 } | 211 } |
214 | 212 |
215 void ConfirmEmailDialogDelegate::OnClosed() { | 213 void ConfirmEmailDialogDelegate::OnClosed() { |
216 base::ResetAndReturn(&callback_).Run(InlineSigninHelper::CLOSE); | 214 base::ResetAndReturn(&callback_).Run(InlineSigninHelper::CLOSE); |
217 } | 215 } |
218 | 216 |
219 void ConfirmEmailDialogDelegate::OnLinkClicked( | 217 void ConfirmEmailDialogDelegate::OnLinkClicked( |
220 WindowOpenDisposition disposition) { | 218 WindowOpenDisposition disposition) { |
221 content::OpenURLParams params( | 219 content::OpenURLParams params( |
222 GURL(chrome::kChromeSyncMergeTroubleshootingURL), | 220 GURL(chrome::kChromeSyncMergeTroubleshootingURL), content::Referrer(), |
223 content::Referrer(), | 221 WindowOpenDisposition::NEW_POPUP, ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
224 NEW_POPUP, | |
225 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | |
226 false); | 222 false); |
227 // It is guaranteed that |web_contents_| is valid here because when it's | 223 // It is guaranteed that |web_contents_| is valid here because when it's |
228 // deleted, the dialog is immediately closed and no further action can be | 224 // deleted, the dialog is immediately closed and no further action can be |
229 // performed. | 225 // performed. |
230 web_contents_->OpenURL(params); | 226 web_contents_->OpenURL(params); |
231 } | 227 } |
232 | 228 |
233 void CloseModalSigninIfNeeded(InlineLoginHandlerImpl* handler) { | 229 void CloseModalSigninIfNeeded(InlineLoginHandlerImpl* handler) { |
234 if (handler && switches::UsePasswordSeparatedSigninFlow()) { | 230 if (handler && switches::UsePasswordSeparatedSigninFlow()) { |
235 Browser* browser = handler->GetDesktopBrowser(); | 231 Browser* browser = handler->GetDesktopBrowser(); |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 } | 929 } |
934 | 930 |
935 if (show_account_management) { | 931 if (show_account_management) { |
936 browser->window()->ShowAvatarBubbleFromAvatarButton( | 932 browser->window()->ShowAvatarBubbleFromAvatarButton( |
937 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, | 933 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, |
938 signin::ManageAccountsParams(), | 934 signin::ManageAccountsParams(), |
939 signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN); | 935 signin_metrics::AccessPoint::ACCESS_POINT_AVATAR_BUBBLE_SIGN_IN); |
940 } | 936 } |
941 } | 937 } |
942 } | 938 } |
OLD | NEW |