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

Side by Side Diff: components/payments/content/payment_request_state.cc

Issue 2805263003: [Payments] Selecting incomplete items will open editors (Closed)
Patch Set: Initial Created 3 years, 8 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 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 "components/payments/content/payment_request_state.h" 5 #include "components/payments/content/payment_request_state.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/autofill/core/browser/autofill_data_util.h" 10 #include "components/autofill/core/browser/autofill_data_util.h"
(...skipping 23 matching lines...) Expand all
34 selected_instrument_(nullptr), 34 selected_instrument_(nullptr),
35 payment_request_delegate_(payment_request_delegate) { 35 payment_request_delegate_(payment_request_delegate) {
36 PopulateProfileCache(); 36 PopulateProfileCache();
37 SetDefaultProfileSelections(); 37 SetDefaultProfileSelections();
38 } 38 }
39 PaymentRequestState::~PaymentRequestState() {} 39 PaymentRequestState::~PaymentRequestState() {}
40 40
41 bool PaymentRequestState::CanMakePayment() const { 41 bool PaymentRequestState::CanMakePayment() const {
42 for (const std::unique_ptr<PaymentInstrument>& instrument : 42 for (const std::unique_ptr<PaymentInstrument>& instrument :
43 available_instruments_) { 43 available_instruments_) {
44 if (instrument.get()->IsValid() && 44 if (spec_->supported_card_networks_set().count(
anthonyvd 2017/04/07 20:08:09 Is this just that the PR spec doesn't require the
Mathieu 2017/04/09 00:35:45 You're right this was unclear. I've rearranged so
45 spec_->supported_card_networks_set().count(
46 instrument.get()->method_name())) { 45 instrument.get()->method_name())) {
47 return true; 46 return true;
48 } 47 }
49 } 48 }
50 return false; 49 return false;
51 } 50 }
52 51
53 void PaymentRequestState::AddObserver(Observer* observer) { 52 void PaymentRequestState::AddObserver(Observer* observer) {
54 CHECK(observer); 53 CHECK(observer);
55 observers_.AddObserver(observer); 54 observers_.AddObserver(observer);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 ->GetInfo(autofill::AutofillType(autofill::PHONE_HOME_WHOLE_NUMBER), 263 ->GetInfo(autofill::AutofillType(autofill::PHONE_HOME_WHOLE_NUMBER),
265 app_locale_) 264 app_locale_)
266 .empty())) { 265 .empty())) {
267 return false; 266 return false;
268 } 267 }
269 268
270 return true; 269 return true;
271 } 270 }
272 271
273 } // namespace payments 272 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698