| 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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 std::string* error_message) { | 677 std::string* error_message) { |
| 678 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 678 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 679 VLOG(1) << "OneClickSigninHelper::CanOffer"; | 679 VLOG(1) << "OneClickSigninHelper::CanOffer"; |
| 680 | 680 |
| 681 if (error_message) | 681 if (error_message) |
| 682 error_message->clear(); | 682 error_message->clear(); |
| 683 | 683 |
| 684 if (!web_contents) | 684 if (!web_contents) |
| 685 return false; | 685 return false; |
| 686 | 686 |
| 687 if (!switches::IsEnableWebBasedSignin()) |
| 688 return false; |
| 689 |
| 687 if (web_contents->GetBrowserContext()->IsOffTheRecord()) | 690 if (web_contents->GetBrowserContext()->IsOffTheRecord()) |
| 688 return false; | 691 return false; |
| 689 | 692 |
| 690 Profile* profile = | 693 Profile* profile = |
| 691 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 694 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 692 if (!profile) | 695 if (!profile) |
| 693 return false; | 696 return false; |
| 694 | 697 |
| 695 SigninManager* manager = | 698 SigninManager* manager = |
| 696 SigninManagerFactory::GetForProfile(profile); | 699 SigninManagerFactory::GetForProfile(profile); |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 // If the web contents is showing a blank page and not about to be closed, | 1524 // If the web contents is showing a blank page and not about to be closed, |
| 1522 // redirect to the NTP or apps page. | 1525 // redirect to the NTP or apps page. |
| 1523 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && | 1526 if (signin::IsContinueUrlForWebBasedSigninFlow(current_url) && |
| 1524 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { | 1527 !signin::IsAutoCloseEnabledInURL(original_continue_url_)) { |
| 1525 RedirectToNtpOrAppsPage( | 1528 RedirectToNtpOrAppsPage( |
| 1526 web_contents(), | 1529 web_contents(), |
| 1527 signin::GetSourceForPromoURL(original_continue_url_)); | 1530 signin::GetSourceForPromoURL(original_continue_url_)); |
| 1528 } | 1531 } |
| 1529 } | 1532 } |
| 1530 } | 1533 } |
| OLD | NEW |