Chromium Code Reviews| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 bool AreWeShowingSignin(GURL url, SyncPromoUI::Source source, | 305 bool AreWeShowingSignin(GURL url, SyncPromoUI::Source source, |
| 306 std::string email) { | 306 std::string email) { |
| 307 GURL::Replacements replacements; | 307 GURL::Replacements replacements; |
| 308 replacements.ClearQuery(); | 308 replacements.ClearQuery(); |
| 309 GURL clean_login_url = | 309 GURL clean_login_url = |
| 310 GURL(GaiaUrls::GetInstance()->service_login_url()).ReplaceComponents( | 310 GURL(GaiaUrls::GetInstance()->service_login_url()).ReplaceComponents( |
| 311 replacements); | 311 replacements); |
| 312 | 312 |
| 313 GURL clean_one_click_url = | 313 GURL clean_one_click_url = |
| 314 GURL(GaiaUrls::GetInstance()->gaia_login_form_realm() + | 314 GURL(GaiaUrls::GetInstance()->gaia_login_form_realm() + |
| 315 "ChromeLoginPrompt").ReplaceComponents(replacements); | 315 "ChromeLoginPrompt").ReplaceComponents(replacements); |
|
Roger Tawa OOO till Jul 10th
2013/05/10 16:52:13
I think you can get rid of this variable.
jwd
2013/05/27 22:52:35
Done.
| |
| 316 | 316 |
| 317 return (url.ReplaceComponents(replacements) == clean_login_url && | 317 return (url.ReplaceComponents(replacements) == clean_login_url && |
| 318 source != SyncPromoUI::SOURCE_UNKNOWN) || | 318 source != SyncPromoUI::SOURCE_UNKNOWN) || |
| 319 (url.ReplaceComponents(replacements) == clean_one_click_url && | 319 (IsValidGaiaSigninRedirectOrResponseURL(url) && |
| 320 url.spec().find("ChromeLoginPrompt") != std::string::npos && | |
| 320 !email.empty()); | 321 !email.empty()); |
| 321 } | 322 } |
| 322 | 323 |
| 323 | 324 |
| 324 // ConfirmEmailDialogDelegate ------------------------------------------------- | 325 // ConfirmEmailDialogDelegate ------------------------------------------------- |
| 325 | 326 |
| 326 class ConfirmEmailDialogDelegate : public TabModalConfirmDialogDelegate { | 327 class ConfirmEmailDialogDelegate : public TabModalConfirmDialogDelegate { |
| 327 public: | 328 public: |
| 328 // Callback indicating action performed by the user. The argument to the | 329 // Callback indicating action performed by the user. The argument to the |
| 329 // callback is the ID of the button pressed by the user. | 330 // callback is the ID of the button pressed by the user. |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1282 } | 1283 } |
| 1283 } | 1284 } |
| 1284 ShowSyncConfirmationBubble(display_bubble); | 1285 ShowSyncConfirmationBubble(display_bubble); |
| 1285 signin_tracker_.reset(); | 1286 signin_tracker_.reset(); |
| 1286 } | 1287 } |
| 1287 | 1288 |
| 1288 void OneClickSigninHelper::SigninSuccess() { | 1289 void OneClickSigninHelper::SigninSuccess() { |
| 1289 ShowSyncConfirmationBubble(true); | 1290 ShowSyncConfirmationBubble(true); |
| 1290 signin_tracker_.reset(); | 1291 signin_tracker_.reset(); |
| 1291 } | 1292 } |
| OLD | NEW |