| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 break; | 404 break; |
| 405 } | 405 } |
| 406 if (action != one_click_signin::HISTOGRAM_MAX) | 406 if (action != one_click_signin::HISTOGRAM_MAX) |
| 407 LogOneClickHistogramValue(action); | 407 LogOneClickHistogramValue(action); |
| 408 } | 408 } |
| 409 | 409 |
| 410 void StartExplicitSync(const StartSyncArgs& args, | 410 void StartExplicitSync(const StartSyncArgs& args, |
| 411 content::WebContents* contents, | 411 content::WebContents* contents, |
| 412 OneClickSigninSyncStarter::StartSyncMode start_mode, | 412 OneClickSigninSyncStarter::StartSyncMode start_mode, |
| 413 ConfirmEmailDialogDelegate::Action action) { | 413 ConfirmEmailDialogDelegate::Action action) { |
| 414 bool enable_inline = switches::IsEnableInlineSignin(); | 414 bool enable_inline = !switches::IsEnableWebBasedSignin(); |
| 415 if (action == ConfirmEmailDialogDelegate::START_SYNC) { | 415 if (action == ConfirmEmailDialogDelegate::START_SYNC) { |
| 416 StartSync(args, start_mode); | 416 StartSync(args, start_mode); |
| 417 if (!enable_inline) { | 417 if (!enable_inline) { |
| 418 // Redirect/tab closing for inline flow is handled by the sync callback. | 418 // Redirect/tab closing for inline flow is handled by the sync callback. |
| 419 OneClickSigninHelper::RedirectToNtpOrAppsPageIfNecessary( | 419 OneClickSigninHelper::RedirectToNtpOrAppsPageIfNecessary( |
| 420 contents, args.source); | 420 contents, args.source); |
| 421 } | 421 } |
| 422 } else { | 422 } else { |
| 423 // Perform a redirection to the NTP/Apps page to hide the blank page when | 423 // Perform a redirection to the NTP/Apps page to hide the blank page when |
| 424 // the action is CLOSE or CREATE_NEW_USER. The redirection is useful when | 424 // the action is CLOSE or CREATE_NEW_USER. The redirection is useful when |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1515 // If the web contents is showing a blank page and not about to be closed, | 1515 // If the web contents is showing a blank page and not about to be closed, |
| 1516 // redirect to the NTP or apps page. | 1516 // redirect to the NTP or apps page. |
| 1517 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1517 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
| 1518 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1518 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
| 1519 RedirectToNtpOrAppsPage( | 1519 RedirectToNtpOrAppsPage( |
| 1520 web_contents(), | 1520 web_contents(), |
| 1521 signin::GetSourceForPromoURL(original_continue_url_)); | 1521 signin::GetSourceForPromoURL(original_continue_url_)); |
| 1522 } | 1522 } |
| 1523 } | 1523 } |
| 1524 } | 1524 } |
| OLD | NEW |