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 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3160 if (!IsManuallyEditingSection(SECTION_SHIPPING) && | 3160 if (!IsManuallyEditingSection(SECTION_SHIPPING) && |
3161 !ShouldUseBillingForShipping() && | 3161 !ShouldUseBillingForShipping() && |
3162 IsShippingAddressRequired()) { | 3162 IsShippingAddressRequired()) { |
3163 active_address_id_ = active_address->object_id(); | 3163 active_address_id_ = active_address->object_id(); |
3164 DCHECK(!active_address_id_.empty()); | 3164 DCHECK(!active_address_id_.empty()); |
3165 } | 3165 } |
3166 | 3166 |
3167 scoped_ptr<wallet::Instrument> inputted_instrument = | 3167 scoped_ptr<wallet::Instrument> inputted_instrument = |
3168 CreateTransientInstrument(); | 3168 CreateTransientInstrument(); |
3169 if (inputted_instrument && IsEditingExistingData(SECTION_CC_BILLING)) { | 3169 if (inputted_instrument && IsEditingExistingData(SECTION_CC_BILLING)) { |
3170 inputted_instrument->set_object_id(active_instrument->object_id()); | 3170 inputted_instrument->set_object_id(active_instrument->object_id()); |
Evan Stade
2013/12/07 02:36:12
then you can remove this?
Dan Beam
2013/12/10 22:04:31
Done.
| |
3171 DCHECK(!inputted_instrument->object_id().empty()); | 3171 DCHECK(!inputted_instrument->object_id().empty()); |
3172 | |
3173 int server_month = active_instrument->expiration_month(); | |
3174 int server_year = active_instrument->expiration_month(); | |
Evan Stade
2013/12/07 02:36:12
I'd rather you pass active_instrument_ to SaveToWa
Dan Beam
2013/12/10 22:04:31
Done.
| |
3175 if (server_month != inputted_instrument->expiration_month() || | |
3176 server_year != inputted_instrument->expiration_year()) { | |
3177 inputted_instrument->set_expiration_differs_from_server(true); | |
3178 } | |
3172 } | 3179 } |
3173 | 3180 |
3174 scoped_ptr<wallet::Address> inputted_address; | 3181 scoped_ptr<wallet::Address> inputted_address; |
3175 if (active_address_id_.empty() && IsShippingAddressRequired()) { | 3182 if (active_address_id_.empty() && IsShippingAddressRequired()) { |
3176 if (ShouldUseBillingForShipping()) { | 3183 if (ShouldUseBillingForShipping()) { |
3177 const wallet::Address& address = inputted_instrument ? | 3184 const wallet::Address& address = inputted_instrument ? |
3178 *inputted_instrument->address() : active_instrument->address(); | 3185 *inputted_instrument->address() : active_instrument->address(); |
3179 // Try to find an exact matched shipping address and use it for shipping, | 3186 // Try to find an exact matched shipping address and use it for shipping, |
3180 // otherwise save it as a new shipping address. http://crbug.com/225442 | 3187 // otherwise save it as a new shipping address. http://crbug.com/225442 |
3181 const wallet::Address* duplicated_address = | 3188 const wallet::Address* duplicated_address = |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3541 view_->UpdateButtonStrip(); | 3548 view_->UpdateButtonStrip(); |
3542 } | 3549 } |
3543 | 3550 |
3544 void AutofillDialogControllerImpl::FetchWalletCookie() { | 3551 void AutofillDialogControllerImpl::FetchWalletCookie() { |
3545 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 3552 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |
3546 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 3553 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |
3547 signin_helper_->StartWalletCookieValueFetch(); | 3554 signin_helper_->StartWalletCookieValueFetch(); |
3548 } | 3555 } |
3549 | 3556 |
3550 } // namespace autofill | 3557 } // namespace autofill |
OLD | NEW |