| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); | 343 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); |
| 344 Profile* profile = Profile::FromBrowserContext( | 344 Profile* profile = Profile::FromBrowserContext( |
| 345 web_contents->GetBrowserContext()); | 345 web_contents->GetBrowserContext()); |
| 346 | 346 |
| 347 // User has accepted one-click sign-in for this account. Never ask again for | 347 // User has accepted one-click sign-in for this account. Never ask again for |
| 348 // this profile. | 348 // this profile. |
| 349 SigninManager::DisableOneClickSignIn(profile); | 349 SigninManager::DisableOneClickSignIn(profile); |
| 350 RecordHistogramAction(one_click_signin::HISTOGRAM_ACCEPTED); | 350 RecordHistogramAction(one_click_signin::HISTOGRAM_ACCEPTED); |
| 351 chrome::FindBrowserWithWebContents(web_contents)->window()-> | 351 chrome::FindBrowserWithWebContents(web_contents)->window()-> |
| 352 ShowOneClickSigninBubble( | 352 ShowOneClickSigninBubble( |
| 353 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE, |
| 353 base::Bind(&StartSync, browser, | 354 base::Bind(&StartSync, browser, |
| 354 OneClickSigninHelper::AUTO_ACCEPT_NONE, session_index_, | 355 OneClickSigninHelper::AUTO_ACCEPT_NONE, session_index_, |
| 355 email_, password_)); | 356 email_, password_)); |
| 356 button_pressed_ = true; | 357 button_pressed_ = true; |
| 357 return true; | 358 return true; |
| 358 } | 359 } |
| 359 | 360 |
| 360 bool OneClickInfoBarDelegateImpl::Cancel() { | 361 bool OneClickInfoBarDelegateImpl::Cancel() { |
| 361 AddEmailToOneClickRejectedList(Profile::FromBrowserContext( | 362 AddEmailToOneClickRejectedList(Profile::FromBrowserContext( |
| 362 owner()->GetWebContents()->GetBrowserContext()), email_); | 363 owner()->GetWebContents()->GetBrowserContext()), email_); |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 one_click_signin::HISTOGRAM_MAX); | 898 one_click_signin::HISTOGRAM_MAX); |
| 898 } else { | 899 } else { |
| 899 OneClickInfoBarDelegateImpl::Create( | 900 OneClickInfoBarDelegateImpl::Create( |
| 900 InfoBarService::FromWebContents(contents), session_index_, email_, | 901 InfoBarService::FromWebContents(contents), session_index_, email_, |
| 901 password_); | 902 password_); |
| 902 } | 903 } |
| 903 break; | 904 break; |
| 904 case AUTO_ACCEPT_ACCEPTED: | 905 case AUTO_ACCEPT_ACCEPTED: |
| 905 SigninManager::DisableOneClickSignIn(profile); | 906 SigninManager::DisableOneClickSignIn(profile); |
| 906 browser->window()->ShowOneClickSigninBubble( | 907 browser->window()->ShowOneClickSigninBubble( |
| 908 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_MODAL_DIALOG, |
| 907 base::Bind(&StartSync, browser, auto_accept_, session_index_, | 909 base::Bind(&StartSync, browser, auto_accept_, session_index_, |
| 908 email_, password_)); | 910 email_, password_)); |
| 909 break; | 911 break; |
| 910 case AUTO_ACCEPT_CONFIGURE: | 912 case AUTO_ACCEPT_CONFIGURE: |
| 911 SigninManager::DisableOneClickSignIn(profile); | 913 SigninManager::DisableOneClickSignIn(profile); |
| 912 StartSync(browser, auto_accept_, session_index_, email_, password_, | 914 StartSync(browser, auto_accept_, session_index_, email_, password_, |
| 913 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); | 915 OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); |
| 914 break; | 916 break; |
| 915 case AUTO_ACCEPT_EXPLICIT: | 917 case AUTO_ACCEPT_EXPLICIT: |
| 916 StartSync(browser, auto_accept_, session_index_, email_, password_, | 918 StartSync(browser, auto_accept_, session_index_, email_, password_, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 break; | 973 break; |
| 972 } | 974 } |
| 973 } | 975 } |
| 974 | 976 |
| 975 RedirectToNTP(); | 977 RedirectToNTP(); |
| 976 } | 978 } |
| 977 | 979 |
| 978 void OneClickSigninHelper::SigninSuccess() { | 980 void OneClickSigninHelper::SigninSuccess() { |
| 979 RedirectToNTP(); | 981 RedirectToNTP(); |
| 980 } | 982 } |
| OLD | NEW |