OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/views/payments/payment_request_dialog_view.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } | 177 } |
178 | 178 |
179 void PaymentRequestDialogView::ShowShippingProfileSheet() { | 179 void PaymentRequestDialogView::ShowShippingProfileSheet() { |
180 view_stack_.Push( | 180 view_stack_.Push( |
181 CreateViewAndInstallController( | 181 CreateViewAndInstallController( |
182 ProfileListViewController::GetShippingProfileViewController( | 182 ProfileListViewController::GetShippingProfileViewController( |
183 request_->spec(), request_->state(), this), | 183 request_->spec(), request_->state(), this), |
184 &controller_map_), | 184 &controller_map_), |
185 /* animate = */ true); | 185 /* animate = */ true); |
186 if (observer_for_testing_) | 186 if (observer_for_testing_) |
187 observer_for_testing_->OnShippingSectionOpened(); | 187 observer_for_testing_->OnShippingAddressSectionOpened(); |
188 } | 188 } |
189 | 189 |
190 void PaymentRequestDialogView::ShowShippingOptionSheet() { | 190 void PaymentRequestDialogView::ShowShippingOptionSheet() { |
191 view_stack_.Push(CreateViewAndInstallController( | 191 view_stack_.Push(CreateViewAndInstallController( |
192 base::MakeUnique<ShippingOptionViewController>( | 192 base::MakeUnique<ShippingOptionViewController>( |
193 request_->spec(), request_->state(), this), | 193 request_->spec(), request_->state(), this), |
194 &controller_map_), | 194 &controller_map_), |
195 /* animate = */ true); | 195 /* animate = */ true); |
| 196 if (observer_for_testing_) |
| 197 observer_for_testing_->OnShippingOptionSectionOpened(); |
196 } | 198 } |
197 | 199 |
198 void PaymentRequestDialogView::ShowCvcUnmaskPrompt( | 200 void PaymentRequestDialogView::ShowCvcUnmaskPrompt( |
199 const autofill::CreditCard& credit_card, | 201 const autofill::CreditCard& credit_card, |
200 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> | 202 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> |
201 result_delegate, | 203 result_delegate, |
202 content::WebContents* web_contents) { | 204 content::WebContents* web_contents) { |
203 view_stack_.Push(CreateViewAndInstallController( | 205 view_stack_.Push(CreateViewAndInstallController( |
204 base::MakeUnique<CvcUnmaskViewController>( | 206 base::MakeUnique<CvcUnmaskViewController>( |
205 request_->spec(), request_->state(), this, | 207 request_->spec(), request_->state(), this, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // When a view that is associated with a controller is removed from this | 302 // When a view that is associated with a controller is removed from this |
301 // view's descendants, dispose of the controller. | 303 // view's descendants, dispose of the controller. |
302 if (!details.is_add && | 304 if (!details.is_add && |
303 controller_map_.find(details.child) != controller_map_.end()) { | 305 controller_map_.find(details.child) != controller_map_.end()) { |
304 DCHECK(!details.move_view); | 306 DCHECK(!details.move_view); |
305 controller_map_.erase(details.child); | 307 controller_map_.erase(details.child); |
306 } | 308 } |
307 } | 309 } |
308 | 310 |
309 } // namespace payments | 311 } // namespace payments |
OLD | NEW |