| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 // Add a specific email to the list of emails rejected for one-click | 224 // Add a specific email to the list of emails rejected for one-click |
| 225 // sign-in, for this profile. | 225 // sign-in, for this profile. |
| 226 void AddEmailToOneClickRejectedList(Profile* profile, | 226 void AddEmailToOneClickRejectedList(Profile* profile, |
| 227 const std::string& email) { | 227 const std::string& email) { |
| 228 ListPrefUpdate updater(profile->GetPrefs(), | 228 ListPrefUpdate updater(profile->GetPrefs(), |
| 229 prefs::kReverseAutologinRejectedEmailList); | 229 prefs::kReverseAutologinRejectedEmailList); |
| 230 updater->AppendIfNotPresent(new base::StringValue(email)); | 230 updater->AppendIfNotPresent(new base::StringValue(email)); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void LogOneClickHistogramValue(int action) { | |
| 234 UMA_HISTOGRAM_ENUMERATION("Signin.OneClickActions", action, | |
| 235 one_click_signin::HISTOGRAM_MAX); | |
| 236 UMA_HISTOGRAM_ENUMERATION("Signin.AllAccessPointActions", action, | |
| 237 one_click_signin::HISTOGRAM_MAX); | |
| 238 } | |
| 239 | |
| 240 void RedirectToNtpOrAppsPageWithIds(int child_id, | 233 void RedirectToNtpOrAppsPageWithIds(int child_id, |
| 241 int route_id, | 234 int route_id, |
| 242 signin::Source source) { | 235 signin::Source source) { |
| 243 content::WebContents* web_contents = tab_util::GetWebContentsByID(child_id, | 236 content::WebContents* web_contents = tab_util::GetWebContentsByID(child_id, |
| 244 route_id); | 237 route_id); |
| 245 if (!web_contents) | 238 if (!web_contents) |
| 246 return; | 239 return; |
| 247 | 240 |
| 248 OneClickSigninHelper::RedirectToNtpOrAppsPage(web_contents, source); | 241 OneClickSigninHelper::RedirectToNtpOrAppsPage(web_contents, source); |
| 249 } | 242 } |
| 250 | 243 |
| 251 // Start syncing with the given user information. | 244 // Start syncing with the given user information. |
| 252 void StartSync(const OneClickSigninHelper::StartSyncArgs& args, | 245 void StartSync(const OneClickSigninHelper::StartSyncArgs& args, |
| 253 OneClickSigninSyncStarter::StartSyncMode start_mode) { | 246 OneClickSigninSyncStarter::StartSyncMode start_mode) { |
| 254 if (start_mode == OneClickSigninSyncStarter::UNDO_SYNC) { | 247 if (start_mode == OneClickSigninSyncStarter::UNDO_SYNC) { |
| 255 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_UNDO); | 248 OneClickSigninHelper::LogHistogramValue(one_click_signin::HISTOGRAM_UNDO); |
| 256 return; | 249 return; |
| 257 } | 250 } |
| 258 | 251 |
| 259 // The wrapper deletes itself once it's done. | 252 // The wrapper deletes itself once it's done. |
| 260 OneClickSigninHelper::SyncStarterWrapper* wrapper = | 253 OneClickSigninHelper::SyncStarterWrapper* wrapper = |
| 261 new OneClickSigninHelper::SyncStarterWrapper(args, start_mode); | 254 new OneClickSigninHelper::SyncStarterWrapper(args, start_mode); |
| 262 wrapper->Start(); | 255 wrapper->Start(); |
| 263 | 256 |
| 264 int action = one_click_signin::HISTOGRAM_MAX; | 257 int action = one_click_signin::HISTOGRAM_MAX; |
| 265 switch (args.auto_accept) { | 258 switch (args.auto_accept) { |
| 266 case OneClickSigninHelper::AUTO_ACCEPT_EXPLICIT: | 259 case OneClickSigninHelper::AUTO_ACCEPT_EXPLICIT: |
| 267 break; | 260 break; |
| 268 case OneClickSigninHelper::AUTO_ACCEPT_ACCEPTED: | 261 case OneClickSigninHelper::AUTO_ACCEPT_ACCEPTED: |
| 269 action = | 262 action = |
| 270 start_mode == OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS ? | 263 start_mode == OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS ? |
| 271 one_click_signin::HISTOGRAM_AUTO_WITH_DEFAULTS : | 264 one_click_signin::HISTOGRAM_AUTO_WITH_DEFAULTS : |
| 272 one_click_signin::HISTOGRAM_AUTO_WITH_ADVANCED; | 265 one_click_signin::HISTOGRAM_AUTO_WITH_ADVANCED; |
| 273 break; | 266 break; |
| 274 case OneClickSigninHelper::AUTO_ACCEPT_CONFIGURE: | 267 case OneClickSigninHelper::AUTO_ACCEPT_CONFIGURE: |
| 275 DCHECK(start_mode == OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); | 268 DCHECK(start_mode == OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); |
| 276 action = one_click_signin::HISTOGRAM_AUTO_WITH_ADVANCED; | 269 action = one_click_signin::HISTOGRAM_AUTO_WITH_ADVANCED; |
| 277 break; | 270 break; |
| 278 default: | 271 default: |
| 279 NOTREACHED() << "Invalid auto_accept: " << args.auto_accept; | 272 NOTREACHED() << "Invalid auto_accept: " << args.auto_accept; |
| 280 break; | 273 break; |
| 281 } | 274 } |
| 282 if (action != one_click_signin::HISTOGRAM_MAX) | 275 if (action != one_click_signin::HISTOGRAM_MAX) |
| 283 LogOneClickHistogramValue(action); | 276 OneClickSigninHelper::LogHistogramValue(action); |
| 284 } | 277 } |
| 285 | 278 |
| 286 void StartExplicitSync(const OneClickSigninHelper::StartSyncArgs& args, | 279 void StartExplicitSync(const OneClickSigninHelper::StartSyncArgs& args, |
| 287 content::WebContents* contents, | 280 content::WebContents* contents, |
| 288 OneClickSigninSyncStarter::StartSyncMode start_mode, | 281 OneClickSigninSyncStarter::StartSyncMode start_mode, |
| 289 ConfirmEmailDialogDelegate::Action action) { | 282 ConfirmEmailDialogDelegate::Action action) { |
| 290 bool enable_inline = !switches::IsEnableWebBasedSignin(); | 283 bool enable_inline = !switches::IsEnableWebBasedSignin(); |
| 291 if (action == ConfirmEmailDialogDelegate::START_SYNC) { | 284 if (action == ConfirmEmailDialogDelegate::START_SYNC) { |
| 292 StartSync(args, start_mode); | 285 StartSync(args, start_mode); |
| 293 if (!enable_inline) { | 286 if (!enable_inline) { |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 if (client) { | 683 if (client) { |
| 691 client->GetPasswordManager()->AddSubmissionCallback( | 684 client->GetPasswordManager()->AddSubmissionCallback( |
| 692 base::Bind(&OneClickSigninHelper::PasswordSubmitted, | 685 base::Bind(&OneClickSigninHelper::PasswordSubmitted, |
| 693 weak_pointer_factory_.GetWeakPtr())); | 686 weak_pointer_factory_.GetWeakPtr())); |
| 694 } | 687 } |
| 695 } | 688 } |
| 696 | 689 |
| 697 OneClickSigninHelper::~OneClickSigninHelper() {} | 690 OneClickSigninHelper::~OneClickSigninHelper() {} |
| 698 | 691 |
| 699 // static | 692 // static |
| 700 void OneClickSigninHelper::LogHistogramValue( | 693 void OneClickSigninHelper::LogHistogramValue(int action) { |
| 701 signin::Source source, int action) { | |
| 702 switch (source) { | |
| 703 case signin::SOURCE_START_PAGE: | |
| 704 UMA_HISTOGRAM_ENUMERATION("Signin.StartPageActions", action, | |
| 705 one_click_signin::HISTOGRAM_MAX); | |
| 706 break; | |
| 707 case signin::SOURCE_NTP_LINK: | |
| 708 UMA_HISTOGRAM_ENUMERATION("Signin.NTPLinkActions", action, | |
| 709 one_click_signin::HISTOGRAM_MAX); | |
| 710 break; | |
| 711 case signin::SOURCE_MENU: | |
| 712 UMA_HISTOGRAM_ENUMERATION("Signin.MenuActions", action, | |
| 713 one_click_signin::HISTOGRAM_MAX); | |
| 714 break; | |
| 715 case signin::SOURCE_SETTINGS: | |
| 716 UMA_HISTOGRAM_ENUMERATION("Signin.SettingsActions", action, | |
| 717 one_click_signin::HISTOGRAM_MAX); | |
| 718 break; | |
| 719 case signin::SOURCE_EXTENSION_INSTALL_BUBBLE: | |
| 720 UMA_HISTOGRAM_ENUMERATION("Signin.ExtensionInstallBubbleActions", action, | |
| 721 one_click_signin::HISTOGRAM_MAX); | |
| 722 break; | |
| 723 case signin::SOURCE_APP_LAUNCHER: | |
| 724 UMA_HISTOGRAM_ENUMERATION("Signin.AppLauncherActions", action, | |
| 725 one_click_signin::HISTOGRAM_MAX); | |
| 726 break; | |
| 727 case signin::SOURCE_APPS_PAGE_LINK: | |
| 728 UMA_HISTOGRAM_ENUMERATION("Signin.AppsPageLinkActions", action, | |
| 729 one_click_signin::HISTOGRAM_MAX); | |
| 730 break; | |
| 731 case signin::SOURCE_BOOKMARK_BUBBLE: | |
| 732 UMA_HISTOGRAM_ENUMERATION("Signin.BookmarkBubbleActions", action, | |
| 733 one_click_signin::HISTOGRAM_MAX); | |
| 734 break; | |
| 735 case signin::SOURCE_AVATAR_BUBBLE_SIGN_IN: | |
| 736 UMA_HISTOGRAM_ENUMERATION("Signin.AvatarBubbleActions", action, | |
| 737 one_click_signin::HISTOGRAM_MAX); | |
| 738 break; | |
| 739 case signin::SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT: | |
| 740 UMA_HISTOGRAM_ENUMERATION("Signin.AvatarBubbleActions", action, | |
| 741 one_click_signin::HISTOGRAM_MAX); | |
| 742 break; | |
| 743 case signin::SOURCE_DEVICES_PAGE: | |
| 744 UMA_HISTOGRAM_ENUMERATION("Signin.DevicesPageActions", action, | |
| 745 one_click_signin::HISTOGRAM_MAX); | |
| 746 break; | |
| 747 case signin::SOURCE_REAUTH: | |
| 748 UMA_HISTOGRAM_ENUMERATION("Signin.ReauthActions", action, | |
| 749 one_click_signin::HISTOGRAM_MAX); | |
| 750 break; | |
| 751 default: | |
| 752 // This switch statement needs to be updated when the enum Source changes. | |
| 753 COMPILE_ASSERT(signin::SOURCE_UNKNOWN == 12, | |
| 754 kSourceEnumHasChangedButNotThisSwitchStatement); | |
| 755 UMA_HISTOGRAM_ENUMERATION("Signin.UnknownActions", action, | |
| 756 one_click_signin::HISTOGRAM_MAX); | |
| 757 } | |
| 758 UMA_HISTOGRAM_ENUMERATION("Signin.AllAccessPointActions", action, | 694 UMA_HISTOGRAM_ENUMERATION("Signin.AllAccessPointActions", action, |
| 759 one_click_signin::HISTOGRAM_MAX); | 695 one_click_signin::HISTOGRAM_MAX); |
| 760 } | 696 } |
| 761 | 697 |
| 762 // static | 698 // static |
| 763 bool OneClickSigninHelper::CanOffer(content::WebContents* web_contents, | 699 bool OneClickSigninHelper::CanOffer(content::WebContents* web_contents, |
| 764 CanOfferFor can_offer_for, | 700 CanOfferFor can_offer_for, |
| 765 const std::string& email, | 701 const std::string& email, |
| 766 std::string* error_message) { | 702 std::string* error_message) { |
| 767 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 703 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1332 | 1268 |
| 1333 // Redirect to the landing page and display an error popup. | 1269 // Redirect to the landing page and display an error popup. |
| 1334 RedirectToNtpOrAppsPage(web_contents(), source_); | 1270 RedirectToNtpOrAppsPage(web_contents(), source_); |
| 1335 LoginUIServiceFactory::GetForProfile(profile)-> | 1271 LoginUIServiceFactory::GetForProfile(profile)-> |
| 1336 DisplayLoginResult(browser, base::UTF8ToUTF16(error_message_)); | 1272 DisplayLoginResult(browser, base::UTF8ToUTF16(error_message_)); |
| 1337 CleanTransientState(); | 1273 CleanTransientState(); |
| 1338 return; | 1274 return; |
| 1339 } | 1275 } |
| 1340 | 1276 |
| 1341 if (AreWeShowingSignin(url, source_, email_)) { | 1277 if (AreWeShowingSignin(url, source_, email_)) { |
| 1342 if (!showing_signin_) { | 1278 if (!showing_signin_) |
| 1343 if (source_ == signin::SOURCE_UNKNOWN) | 1279 LogHistogramValue(one_click_signin::HISTOGRAM_SHOWN); |
| 1344 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_SHOWN); | |
| 1345 else | |
| 1346 LogHistogramValue(source_, one_click_signin::HISTOGRAM_SHOWN); | |
| 1347 } | |
| 1348 showing_signin_ = true; | 1280 showing_signin_ = true; |
| 1349 } | 1281 } |
| 1350 | 1282 |
| 1351 // When Gaia finally redirects to the continue URL, Gaia will add some | 1283 // When Gaia finally redirects to the continue URL, Gaia will add some |
| 1352 // extra query parameters. So ignore the parameters when checking to see | 1284 // extra query parameters. So ignore the parameters when checking to see |
| 1353 // if the user has continued. Sometimes locales will redirect to a country- | 1285 // if the user has continued. Sometimes locales will redirect to a country- |
| 1354 // specific TLD so just make sure it's a valid domain instead of comparing | 1286 // specific TLD so just make sure it's a valid domain instead of comparing |
| 1355 // for an exact match. | 1287 // for an exact match. |
| 1356 GURL::Replacements replacements; | 1288 GURL::Replacements replacements; |
| 1357 replacements.ClearQuery(); | 1289 replacements.ClearQuery(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1439 | 1371 |
| 1440 Browser* browser = chrome::FindBrowserWithWebContents(contents); | 1372 Browser* browser = chrome::FindBrowserWithWebContents(contents); |
| 1441 | 1373 |
| 1442 VLOG(1) << "OneClickSigninHelper::DidStopLoading: signin is go." | 1374 VLOG(1) << "OneClickSigninHelper::DidStopLoading: signin is go." |
| 1443 << " auto_accept=" << auto_accept_ | 1375 << " auto_accept=" << auto_accept_ |
| 1444 << " source=" << source_; | 1376 << " source=" << source_; |
| 1445 | 1377 |
| 1446 switch (auto_accept_) { | 1378 switch (auto_accept_) { |
| 1447 case AUTO_ACCEPT_NONE: | 1379 case AUTO_ACCEPT_NONE: |
| 1448 if (showing_signin_) | 1380 if (showing_signin_) |
| 1449 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_DISMISSED); | 1381 LogHistogramValue(one_click_signin::HISTOGRAM_DISMISSED); |
| 1450 break; | 1382 break; |
| 1451 case AUTO_ACCEPT_ACCEPTED: | 1383 case AUTO_ACCEPT_ACCEPTED: |
| 1452 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); | 1384 LogHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); |
| 1453 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_WITH_DEFAULTS); | 1385 LogHistogramValue(one_click_signin::HISTOGRAM_WITH_DEFAULTS); |
| 1454 SigninManager::DisableOneClickSignIn(profile->GetPrefs()); | 1386 SigninManager::DisableOneClickSignIn(profile->GetPrefs()); |
| 1455 // Start syncing with the default settings - prompt the user to sign in | 1387 // Start syncing with the default settings - prompt the user to sign in |
| 1456 // first. | 1388 // first. |
| 1457 if (!do_not_start_sync_for_testing_) { | 1389 if (!do_not_start_sync_for_testing_) { |
| 1458 StartSync( | 1390 StartSync( |
| 1459 StartSyncArgs(profile, browser, auto_accept_, | 1391 StartSyncArgs(profile, browser, auto_accept_, |
| 1460 session_index_, email_, password_, "", | 1392 session_index_, email_, password_, "", |
| 1461 NULL /* don't force sync setup in same tab */, | 1393 NULL /* don't force sync setup in same tab */, |
| 1462 true /* confirmation_required */, source_, | 1394 true /* confirmation_required */, source_, |
| 1463 CreateSyncStarterCallback()), | 1395 CreateSyncStarterCallback()), |
| 1464 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); | 1396 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); |
| 1465 } | 1397 } |
| 1466 break; | 1398 break; |
| 1467 case AUTO_ACCEPT_CONFIGURE: | 1399 case AUTO_ACCEPT_CONFIGURE: |
| 1468 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); | 1400 LogHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); |
| 1469 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_WITH_ADVANCED); | 1401 LogHistogramValue(one_click_signin::HISTOGRAM_WITH_ADVANCED); |
| 1470 SigninManager::DisableOneClickSignIn(profile->GetPrefs()); | 1402 SigninManager::DisableOneClickSignIn(profile->GetPrefs()); |
| 1471 // Display the extra confirmation (even in the SAML case) in case this | 1403 // Display the extra confirmation (even in the SAML case) in case this |
| 1472 // was an untrusted renderer. | 1404 // was an untrusted renderer. |
| 1473 if (!do_not_start_sync_for_testing_) { | 1405 if (!do_not_start_sync_for_testing_) { |
| 1474 StartSync( | 1406 StartSync( |
| 1475 StartSyncArgs(profile, browser, auto_accept_, | 1407 StartSyncArgs(profile, browser, auto_accept_, |
| 1476 session_index_, email_, password_, "", | 1408 session_index_, email_, password_, "", |
| 1477 NULL /* don't force sync setup in same tab */, | 1409 NULL /* don't force sync setup in same tab */, |
| 1478 true /* confirmation_required */, source_, | 1410 true /* confirmation_required */, source_, |
| 1479 CreateSyncStarterCallback()), | 1411 CreateSyncStarterCallback()), |
| 1480 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); | 1412 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); |
| 1481 } | 1413 } |
| 1482 break; | 1414 break; |
| 1483 case AUTO_ACCEPT_EXPLICIT: { | 1415 case AUTO_ACCEPT_EXPLICIT: { |
| 1484 signin::Source original_source = | 1416 signin::Source original_source = |
| 1485 signin::GetSourceForPromoURL(original_continue_url_); | 1417 signin::GetSourceForPromoURL(original_continue_url_); |
| 1486 if (switched_to_advanced_) { | 1418 if (switched_to_advanced_) { |
| 1487 LogHistogramValue(original_source, | 1419 LogHistogramValue(one_click_signin::HISTOGRAM_WITH_ADVANCED); |
| 1488 one_click_signin::HISTOGRAM_WITH_ADVANCED); | 1420 LogHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); |
| 1489 LogHistogramValue(original_source, | |
| 1490 one_click_signin::HISTOGRAM_ACCEPTED); | |
| 1491 } else { | 1421 } else { |
| 1492 LogHistogramValue(source_, one_click_signin::HISTOGRAM_ACCEPTED); | 1422 LogHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); |
| 1493 LogHistogramValue(source_, one_click_signin::HISTOGRAM_WITH_DEFAULTS); | 1423 LogHistogramValue(one_click_signin::HISTOGRAM_WITH_DEFAULTS); |
| 1494 } | 1424 } |
| 1495 | 1425 |
| 1496 // - If sign in was initiated from the NTP or the hotdog menu, sync with | 1426 // - If sign in was initiated from the NTP or the hotdog menu, sync with |
| 1497 // default settings. | 1427 // default settings. |
| 1498 // - If sign in was initiated from the settings page for first time sync | 1428 // - If sign in was initiated from the settings page for first time sync |
| 1499 // set up, show the advanced sync settings dialog. | 1429 // set up, show the advanced sync settings dialog. |
| 1500 // - If sign in was initiated from the settings page due to a re-auth when | 1430 // - If sign in was initiated from the settings page due to a re-auth when |
| 1501 // sync was already setup, simply navigate back to the settings page. | 1431 // sync was already setup, simply navigate back to the settings page. |
| 1502 ProfileSyncService* sync_service = | 1432 ProfileSyncService* sync_service = |
| 1503 ProfileSyncServiceFactory::GetForProfile(profile); | 1433 ProfileSyncServiceFactory::GetForProfile(profile); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 // so that when sign in and sync setup are successful, we can redirect to | 1467 // so that when sign in and sync setup are successful, we can redirect to |
| 1538 // the correct URL, or auto-close the gaia sign in tab. | 1468 // the correct URL, or auto-close the gaia sign in tab. |
| 1539 if (original_source == signin::SOURCE_SETTINGS) { | 1469 if (original_source == signin::SOURCE_SETTINGS) { |
| 1540 // The observer deletes itself once it's done. | 1470 // The observer deletes itself once it's done. |
| 1541 new OneClickSigninSyncObserver(contents, original_continue_url_); | 1471 new OneClickSigninSyncObserver(contents, original_continue_url_); |
| 1542 } | 1472 } |
| 1543 break; | 1473 break; |
| 1544 } | 1474 } |
| 1545 case AUTO_ACCEPT_REJECTED_FOR_PROFILE: | 1475 case AUTO_ACCEPT_REJECTED_FOR_PROFILE: |
| 1546 AddEmailToOneClickRejectedList(profile, email_); | 1476 AddEmailToOneClickRejectedList(profile, email_); |
| 1547 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_REJECTED); | 1477 LogHistogramValue(one_click_signin::HISTOGRAM_REJECTED); |
| 1548 break; | 1478 break; |
| 1549 default: | 1479 default: |
| 1550 NOTREACHED() << "Invalid auto_accept=" << auto_accept_; | 1480 NOTREACHED() << "Invalid auto_accept=" << auto_accept_; |
| 1551 break; | 1481 break; |
| 1552 } | 1482 } |
| 1553 | 1483 |
| 1554 CleanTransientState(); | 1484 CleanTransientState(); |
| 1555 } | 1485 } |
| 1556 | 1486 |
| 1557 OneClickSigninSyncStarter::Callback | 1487 OneClickSigninSyncStarter::Callback |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1572 // If the web contents is showing a blank page and not about to be closed, | 1502 // If the web contents is showing a blank page and not about to be closed, |
| 1573 // redirect to the NTP or apps page. | 1503 // redirect to the NTP or apps page. |
| 1574 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1504 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
| 1575 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1505 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
| 1576 RedirectToNtpOrAppsPage( | 1506 RedirectToNtpOrAppsPage( |
| 1577 web_contents(), | 1507 web_contents(), |
| 1578 signin::GetSourceForPromoURL(original_continue_url_)); | 1508 signin::GetSourceForPromoURL(original_continue_url_)); |
| 1579 } | 1509 } |
| 1580 } | 1510 } |
| 1581 } | 1511 } |
| OLD | NEW |