| 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 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 void OneClickSigninHelper::SetDoNotClearPendingEmailForTesting() { | 1094 void OneClickSigninHelper::SetDoNotClearPendingEmailForTesting() { |
| 1095 do_not_clear_pending_email_ = true; | 1095 do_not_clear_pending_email_ = true; |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 void OneClickSigninHelper::set_do_not_start_sync_for_testing() { | 1098 void OneClickSigninHelper::set_do_not_start_sync_for_testing() { |
| 1099 do_not_start_sync_for_testing_ = true; | 1099 do_not_start_sync_for_testing_ = true; |
| 1100 } | 1100 } |
| 1101 | 1101 |
| 1102 void OneClickSigninHelper::NavigateToPendingEntry( | 1102 void OneClickSigninHelper::DidCreatePendingEntry( |
| 1103 const GURL& url, | 1103 const GURL& url, |
| 1104 content::NavigationController::ReloadType reload_type) { | 1104 content::NavigationController::ReloadType reload_type) { |
| 1105 VLOG(1) << "OneClickSigninHelper::NavigateToPendingEntry: url=" << url.spec(); | 1105 VLOG(1) << "OneClickSigninHelper::DidCreatePendingEntry: url=" << url.spec(); |
| 1106 // If the tab navigates to a new page, and this page is not a valid Gaia | 1106 // If the tab navigates to a new page, and this page is not a valid Gaia |
| 1107 // sign in redirect or reponse, or the expected continue URL, make sure to | 1107 // sign in redirect or reponse, or the expected continue URL, make sure to |
| 1108 // clear the internal state. This is needed to detect navigations in the | 1108 // clear the internal state. This is needed to detect navigations in the |
| 1109 // middle of the sign in process that may redirect back to the sign in | 1109 // middle of the sign in process that may redirect back to the sign in |
| 1110 // process (see crbug.com/181163 for details). | 1110 // process (see crbug.com/181163 for details). |
| 1111 const GURL continue_url = signin::GetNextPageURLForPromoURL( | 1111 const GURL continue_url = signin::GetNextPageURLForPromoURL( |
| 1112 signin::GetPromoURL(signin::SOURCE_START_PAGE, false)); | 1112 signin::GetPromoURL(signin::SOURCE_START_PAGE, false)); |
| 1113 GURL::Replacements replacements; | 1113 GURL::Replacements replacements; |
| 1114 replacements.ClearQuery(); | 1114 replacements.ClearQuery(); |
| 1115 | 1115 |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 // If the web contents is showing a blank page and not about to be closed, | 1478 // If the web contents is showing a blank page and not about to be closed, |
| 1479 // redirect to the NTP or apps page. | 1479 // redirect to the NTP or apps page. |
| 1480 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1480 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
| 1481 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1481 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
| 1482 RedirectToNtpOrAppsPage( | 1482 RedirectToNtpOrAppsPage( |
| 1483 web_contents(), | 1483 web_contents(), |
| 1484 signin::GetSourceForPromoURL(original_continue_url_)); | 1484 signin::GetSourceForPromoURL(original_continue_url_)); |
| 1485 } | 1485 } |
| 1486 } | 1486 } |
| 1487 } | 1487 } |
| OLD | NEW |