OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/autofill/autofill_dialog_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 OpenTabWithUrl(url); | 2007 OpenTabWithUrl(url); |
2008 } | 2008 } |
2009 | 2009 |
2010 void AutofillDialogControllerImpl::SignInLinkClicked() { | 2010 void AutofillDialogControllerImpl::SignInLinkClicked() { |
2011 ScopedViewUpdates updates(view_.get()); | 2011 ScopedViewUpdates updates(view_.get()); |
2012 | 2012 |
2013 if (SignedInState() == NOT_CHECKED) { | 2013 if (SignedInState() == NOT_CHECKED) { |
2014 handling_use_wallet_link_click_ = true; | 2014 handling_use_wallet_link_click_ = true; |
2015 account_chooser_model_->SelectWalletAccount(0); | 2015 account_chooser_model_->SelectWalletAccount(0); |
2016 FetchWalletCookie(); | 2016 FetchWalletCookie(); |
2017 view_->UpdateAccountChooser(); | |
2018 } else if (signin_registrar_.IsEmpty()) { | 2017 } else if (signin_registrar_.IsEmpty()) { |
2019 // Start sign in. | 2018 // Start sign in. |
2020 waiting_for_explicit_sign_in_response_ = true; | 2019 waiting_for_explicit_sign_in_response_ = true; |
2021 content::Source<content::NavigationController> source(view_->ShowSignIn()); | 2020 content::Source<content::NavigationController> source(view_->ShowSignIn()); |
2022 signin_registrar_.Add( | 2021 signin_registrar_.Add( |
2023 this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source); | 2022 this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source); |
2024 view_->UpdateAccountChooser(); | |
2025 | 2023 |
2026 GetMetricLogger().LogDialogUiEvent( | 2024 GetMetricLogger().LogDialogUiEvent( |
2027 AutofillMetrics::DIALOG_UI_SIGNIN_SHOWN); | 2025 AutofillMetrics::DIALOG_UI_SIGNIN_SHOWN); |
2028 } else { | 2026 } else { |
2029 waiting_for_explicit_sign_in_response_ = false; | 2027 waiting_for_explicit_sign_in_response_ = false; |
2030 HideSignIn(); | 2028 HideSignIn(); |
2031 } | 2029 } |
| 2030 |
| 2031 view_->UpdateAccountChooser(); |
| 2032 view_->UpdateButtonStrip(); |
2032 } | 2033 } |
2033 | 2034 |
2034 void AutofillDialogControllerImpl::NotificationCheckboxStateChanged( | 2035 void AutofillDialogControllerImpl::NotificationCheckboxStateChanged( |
2035 DialogNotification::Type type, bool checked) { | 2036 DialogNotification::Type type, bool checked) { |
2036 if (type == DialogNotification::WALLET_USAGE_CONFIRMATION) { | 2037 if (type == DialogNotification::WALLET_USAGE_CONFIRMATION) { |
2037 if (checked) { | 2038 if (checked) { |
2038 account_chooser_model_->SelectWalletAccount( | 2039 account_chooser_model_->SelectWalletAccount( |
2039 GetWalletClient()->user_index()); | 2040 GetWalletClient()->user_index()); |
2040 } else { | 2041 } else { |
2041 account_chooser_model_->SelectUseAutofill(); | 2042 account_chooser_model_->SelectUseAutofill(); |
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3535 view_->UpdateButtonStrip(); | 3536 view_->UpdateButtonStrip(); |
3536 } | 3537 } |
3537 | 3538 |
3538 void AutofillDialogControllerImpl::FetchWalletCookie() { | 3539 void AutofillDialogControllerImpl::FetchWalletCookie() { |
3539 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 3540 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |
3540 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 3541 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |
3541 signin_helper_->StartWalletCookieValueFetch(); | 3542 signin_helper_->StartWalletCookieValueFetch(); |
3542 } | 3543 } |
3543 | 3544 |
3544 } // namespace autofill | 3545 } // namespace autofill |
OLD | NEW |