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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 | 882 |
883 content::OpenURLParams params( | 883 content::OpenURLParams params( |
884 GURL(chrome::kChromeUINewTabURL), | 884 GURL(chrome::kChromeUINewTabURL), |
885 content::Referrer(), | 885 content::Referrer(), |
886 CURRENT_TAB, | 886 CURRENT_TAB, |
887 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 887 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
888 false); | 888 false); |
889 contents->OpenURL(params); | 889 contents->OpenURL(params); |
890 | 890 |
891 error_message_.clear(); | 891 error_message_.clear(); |
892 signin_tracker_.reset(); | |
893 } | 892 } |
894 | 893 |
895 void OneClickSigninHelper::CleanTransientState() { | 894 void OneClickSigninHelper::CleanTransientState() { |
896 VLOG(1) << "OneClickSigninHelper::CleanTransientState"; | 895 VLOG(1) << "OneClickSigninHelper::CleanTransientState"; |
897 email_.clear(); | 896 email_.clear(); |
898 password_.clear(); | 897 password_.clear(); |
899 auto_accept_ = AUTO_ACCEPT_NONE; | 898 auto_accept_ = AUTO_ACCEPT_NONE; |
900 source_ = SyncPromoUI::SOURCE_UNKNOWN; | 899 source_ = SyncPromoUI::SOURCE_UNKNOWN; |
901 continue_url_ = GURL(); | 900 continue_url_ = GURL(); |
902 | 901 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 sync_service->AddObserver(this); | 1097 sync_service->AddObserver(this); |
1099 } | 1098 } |
1100 | 1099 |
1101 // If this explicit sign in is not from settings page/webstore, show the | 1100 // If this explicit sign in is not from settings page/webstore, show the |
1102 // NTP after sign in completes. In the case of the settings page, it will | 1101 // NTP after sign in completes. In the case of the settings page, it will |
1103 // get closed by SyncSetupHandler. In the case of webstore, it will | 1102 // get closed by SyncSetupHandler. In the case of webstore, it will |
1104 // redirect back to webstore. | 1103 // redirect back to webstore. |
1105 if (source_ != SyncPromoUI::SOURCE_SETTINGS && | 1104 if (source_ != SyncPromoUI::SOURCE_SETTINGS && |
1106 source_ != SyncPromoUI::SOURCE_WEBSTORE_INSTALL) { | 1105 source_ != SyncPromoUI::SOURCE_WEBSTORE_INSTALL) { |
1107 signin_tracker_.reset(new SigninTracker(profile, this)); | 1106 signin_tracker_.reset(new SigninTracker(profile, this)); |
| 1107 RedirectToNTP(); |
1108 } | 1108 } |
1109 break; | 1109 break; |
1110 } | 1110 } |
1111 case AUTO_ACCEPT_REJECTED_FOR_PROFILE: | 1111 case AUTO_ACCEPT_REJECTED_FOR_PROFILE: |
1112 AddEmailToOneClickRejectedList(profile, email_); | 1112 AddEmailToOneClickRejectedList(profile, email_); |
1113 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Reverse", | 1113 UMA_HISTOGRAM_ENUMERATION("AutoLogin.Reverse", |
1114 one_click_signin::HISTOGRAM_REJECTED, | 1114 one_click_signin::HISTOGRAM_REJECTED, |
1115 one_click_signin::HISTOGRAM_MAX); | 1115 one_click_signin::HISTOGRAM_MAX); |
1116 break; | 1116 break; |
1117 default: | 1117 default: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: | 1165 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: |
1166 error_message_ = l10n_util::GetStringUTF8(IDS_SYNC_UNRECOVERABLE_ERROR); | 1166 error_message_ = l10n_util::GetStringUTF8(IDS_SYNC_UNRECOVERABLE_ERROR); |
1167 break; | 1167 break; |
1168 default: | 1168 default: |
1169 error_message_ = l10n_util::GetStringUTF8(IDS_SYNC_ERROR_SIGNING_IN); | 1169 error_message_ = l10n_util::GetStringUTF8(IDS_SYNC_ERROR_SIGNING_IN); |
1170 break; | 1170 break; |
1171 } | 1171 } |
1172 } | 1172 } |
1173 | 1173 |
1174 RedirectToNTP(); | 1174 RedirectToNTP(); |
| 1175 signin_tracker_.reset(); |
1175 } | 1176 } |
1176 | 1177 |
1177 void OneClickSigninHelper::SigninSuccess() { | 1178 void OneClickSigninHelper::SigninSuccess() { |
1178 RedirectToNTP(); | 1179 signin_tracker_.reset(); |
1179 } | 1180 } |
OLD | NEW |