| 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/sync/one_click_signin_helper.h" | 5 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 // static | 1021 // static |
| 1022 void OneClickSigninHelper::RemoveSigninRedirectURLHistoryItem( | 1022 void OneClickSigninHelper::RemoveSigninRedirectURLHistoryItem( |
| 1023 content::WebContents* web_contents) { | 1023 content::WebContents* web_contents) { |
| 1024 // Only actually remove the item if it's the blank.html continue url. | 1024 // Only actually remove the item if it's the blank.html continue url. |
| 1025 if (signin::IsContinueUrlForWebBasedSigninFlow( | 1025 if (signin::IsContinueUrlForWebBasedSigninFlow( |
| 1026 web_contents->GetLastCommittedURL())) { | 1026 web_contents->GetLastCommittedURL())) { |
| 1027 new CurrentHistoryCleaner(web_contents); // will self-destruct when done | 1027 new CurrentHistoryCleaner(web_contents); // will self-destruct when done |
| 1028 } | 1028 } |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 // static |
| 1031 void OneClickSigninHelper::ShowSigninErrorBubble(Browser* browser, | 1032 void OneClickSigninHelper::ShowSigninErrorBubble(Browser* browser, |
| 1032 const std::string& error) { | 1033 const std::string& error) { |
| 1033 DCHECK(!error.empty()); | 1034 DCHECK(!error.empty()); |
| 1034 | 1035 |
| 1035 browser->window()->ShowOneClickSigninBubble( | 1036 browser->window()->ShowOneClickSigninBubble( |
| 1036 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE, | 1037 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE, |
| 1037 string16(), /* no SAML email */ | 1038 string16(), /* no SAML email */ |
| 1038 UTF8ToUTF16(error), | 1039 UTF8ToUTF16(error), |
| 1039 // This callback is never invoked. | 1040 // This callback is never invoked. |
| 1040 // TODO(rogerta): Separate out the bubble API so we don't have to pass | 1041 // TODO(rogerta): Separate out the bubble API so we don't have to pass |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 // If the web contents is showing a blank page and not about to be closed, | 1480 // If the web contents is showing a blank page and not about to be closed, |
| 1480 // redirect to the NTP or apps page. | 1481 // redirect to the NTP or apps page. |
| 1481 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1482 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
| 1482 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1483 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
| 1483 RedirectToNtpOrAppsPage( | 1484 RedirectToNtpOrAppsPage( |
| 1484 web_contents(), | 1485 web_contents(), |
| 1485 signin::GetSourceForPromoURL(original_continue_url_)); | 1486 signin::GetSourceForPromoURL(original_continue_url_)); |
| 1486 } | 1487 } |
| 1487 } | 1488 } |
| 1488 } | 1489 } |
| OLD | NEW |