Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(783)

Side by Side Diff: chrome/browser/ui/views/payments/payment_method_view_controller.cc

Issue 2715213005: [Payments] Add the pay button, and control its enabled state (Closed)
Patch Set: addressed comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_method_view_controller.h" 5 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 return std::move(row); 128 return std::move(row);
129 } 129 }
130 130
131 void SelectedStateChanged() override { 131 void SelectedStateChanged() override {
132 // This could be called before CreateItemView, so before |checkmark_| is 132 // This could be called before CreateItemView, so before |checkmark_| is
133 // instantiated. 133 // instantiated.
134 if (checkmark_) 134 if (checkmark_)
135 checkmark_->SetVisible(selected()); 135 checkmark_->SetVisible(selected());
136 136
137 request()->set_selected_credit_card(card_); 137 request()->SetSelectedCreditCard(card_);
138 } 138 }
139 139
140 // views::ButtonListener: 140 // views::ButtonListener:
141 void ButtonPressed(views::Button* sender, const ui::Event& event) override { 141 void ButtonPressed(views::Button* sender, const ui::Event& event) override {
142 if (IsComplete()) { 142 if (IsComplete()) {
143 list()->SelectItem(this); 143 list()->SelectItem(this);
144 } else { 144 } else {
145 // TODO(anthonyvd): Display the editor, pre-populated with the data that 145 // TODO(anthonyvd): Display the editor, pre-populated with the data that
146 // already exists in |card|. 146 // already exists in |card|.
147 } 147 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 PaymentMethodViewControllerTags::ADD_CREDIT_CARD_BUTTON): 219 PaymentMethodViewControllerTags::ADD_CREDIT_CARD_BUTTON):
220 dialog()->ShowCreditCardEditor(); 220 dialog()->ShowCreditCardEditor();
221 break; 221 break;
222 default: 222 default:
223 PaymentRequestSheetController::ButtonPressed(sender, event); 223 PaymentRequestSheetController::ButtonPressed(sender, event);
224 break; 224 break;
225 } 225 }
226 } 226 }
227 227
228 } // namespace payments 228 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698