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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 LogHistogramValue(source_, one_click_signin::HISTOGRAM_WITH_DEFAULTS); | 1177 LogHistogramValue(source_, one_click_signin::HISTOGRAM_WITH_DEFAULTS); |
1178 } | 1178 } |
1179 OneClickSigninSyncStarter::StartSyncMode start_mode = | 1179 OneClickSigninSyncStarter::StartSyncMode start_mode = |
1180 source_ == SyncPromoUI::SOURCE_SETTINGS ? | 1180 source_ == SyncPromoUI::SOURCE_SETTINGS ? |
1181 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST : | 1181 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST : |
1182 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS; | 1182 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS; |
1183 | 1183 |
1184 std::string last_email = | 1184 std::string last_email = |
1185 profile->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername); | 1185 profile->GetPrefs()->GetString(prefs::kGoogleServicesLastUsername); |
1186 | 1186 |
1187 if (!last_email.empty() && last_email != email_) { | 1187 if (!last_email.empty() && !gaia::AreEmailsSame(last_email, email_)) { |
1188 // If the new email address is different from the email address that | 1188 // If the new email address is different from the email address that |
1189 // just signed in, show a confirmation dialog. | 1189 // just signed in, show a confirmation dialog. |
1190 | 1190 |
1191 // No need to display a second confirmation so pass false below. | 1191 // No need to display a second confirmation so pass false below. |
1192 // TODO(atwilson): Move this into OneClickSigninSyncStarter. | 1192 // TODO(atwilson): Move this into OneClickSigninSyncStarter. |
1193 ConfirmEmailDialogDelegate::AskForConfirmation( | 1193 ConfirmEmailDialogDelegate::AskForConfirmation( |
1194 contents, | 1194 contents, |
1195 last_email, | 1195 last_email, |
1196 email_, | 1196 email_, |
1197 base::Bind( | 1197 base::Bind( |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 contents->GetController().LoadURL(redirect_url_, | 1263 contents->GetController().LoadURL(redirect_url_, |
1264 content::Referrer(), | 1264 content::Referrer(), |
1265 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 1265 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
1266 std::string()); | 1266 std::string()); |
1267 } | 1267 } |
1268 | 1268 |
1269 // Clear the redirect URL. | 1269 // Clear the redirect URL. |
1270 redirect_url_ = GURL(); | 1270 redirect_url_ = GURL(); |
1271 sync_service->RemoveObserver(this); | 1271 sync_service->RemoveObserver(this); |
1272 } | 1272 } |
OLD | NEW |