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 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 << " source=" << source_; | 1468 << " source=" << source_; |
1469 | 1469 |
1470 switch (auto_accept_) { | 1470 switch (auto_accept_) { |
1471 case AUTO_ACCEPT_NONE: | 1471 case AUTO_ACCEPT_NONE: |
1472 if (showing_signin_) | 1472 if (showing_signin_) |
1473 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_DISMISSED); | 1473 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_DISMISSED); |
1474 break; | 1474 break; |
1475 case AUTO_ACCEPT_ACCEPTED: | 1475 case AUTO_ACCEPT_ACCEPTED: |
1476 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); | 1476 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); |
1477 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_WITH_DEFAULTS); | 1477 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_WITH_DEFAULTS); |
1478 SigninManager::DisableOneClickSignIn(profile); | 1478 SigninManager::DisableOneClickSignIn(profile->GetPrefs()); |
1479 // Start syncing with the default settings - prompt the user to sign in | 1479 // Start syncing with the default settings - prompt the user to sign in |
1480 // first. | 1480 // first. |
1481 if (!do_not_start_sync_for_testing_) { | 1481 if (!do_not_start_sync_for_testing_) { |
1482 StartSync( | 1482 StartSync( |
1483 StartSyncArgs(profile, browser, auto_accept_, | 1483 StartSyncArgs(profile, browser, auto_accept_, |
1484 session_index_, email_, password_, "", | 1484 session_index_, email_, password_, "", |
1485 NULL /* don't force sync setup in same tab */, | 1485 NULL /* don't force sync setup in same tab */, |
1486 true /* confirmation_required */, source_, | 1486 true /* confirmation_required */, source_, |
1487 CreateSyncStarterCallback()), | 1487 CreateSyncStarterCallback()), |
1488 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); | 1488 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); |
1489 } | 1489 } |
1490 break; | 1490 break; |
1491 case AUTO_ACCEPT_CONFIGURE: | 1491 case AUTO_ACCEPT_CONFIGURE: |
1492 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); | 1492 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_ACCEPTED); |
1493 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_WITH_ADVANCED); | 1493 LogOneClickHistogramValue(one_click_signin::HISTOGRAM_WITH_ADVANCED); |
1494 SigninManager::DisableOneClickSignIn(profile); | 1494 SigninManager::DisableOneClickSignIn(profile->GetPrefs()); |
1495 // Display the extra confirmation (even in the SAML case) in case this | 1495 // Display the extra confirmation (even in the SAML case) in case this |
1496 // was an untrusted renderer. | 1496 // was an untrusted renderer. |
1497 if (!do_not_start_sync_for_testing_) { | 1497 if (!do_not_start_sync_for_testing_) { |
1498 StartSync( | 1498 StartSync( |
1499 StartSyncArgs(profile, browser, auto_accept_, | 1499 StartSyncArgs(profile, browser, auto_accept_, |
1500 session_index_, email_, password_, "", | 1500 session_index_, email_, password_, "", |
1501 NULL /* don't force sync setup in same tab */, | 1501 NULL /* don't force sync setup in same tab */, |
1502 true /* confirmation_required */, source_, | 1502 true /* confirmation_required */, source_, |
1503 CreateSyncStarterCallback()), | 1503 CreateSyncStarterCallback()), |
1504 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); | 1504 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 // If the web contents is showing a blank page and not about to be closed, | 1655 // If the web contents is showing a blank page and not about to be closed, |
1656 // redirect to the NTP or apps page. | 1656 // redirect to the NTP or apps page. |
1657 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1657 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
1658 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1658 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
1659 RedirectToNtpOrAppsPage( | 1659 RedirectToNtpOrAppsPage( |
1660 web_contents(), | 1660 web_contents(), |
1661 signin::GetSourceForPromoURL(original_continue_url_)); | 1661 signin::GetSourceForPromoURL(original_continue_url_)); |
1662 } | 1662 } |
1663 } | 1663 } |
1664 } | 1664 } |
OLD | NEW |