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

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

Issue 2803443003: [Payments] Added region load failure tolerance and tests to PR editor. (Closed)
Patch Set: Removed unneeded include. 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 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 #ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ 5 #ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_
6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ 6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/observer_list.h" 13 #include "base/observer_list.h"
13 #include "components/payments/content/payment_request.mojom.h" 14 #include "components/payments/content/payment_request.mojom.h"
14 #include "components/payments/content/payment_response_helper.h" 15 #include "components/payments/content/payment_response_helper.h"
15 16
17 namespace i18n {
18 namespace addressinput {
19 class Storage;
20 class Source;
21 } // namespace addressinput
22 } // namespace i18n
23
16 namespace autofill { 24 namespace autofill {
17 class AutofillProfile; 25 class AutofillProfile;
18 class PersonalDataManager; 26 class PersonalDataManager;
19 } // namespace autofill 27 } // namespace autofill
20 28
21 namespace payments { 29 namespace payments {
22 30
23 class PaymentInstrument; 31 class PaymentInstrument;
24 class PaymentRequestDelegate; 32 class PaymentRequestDelegate;
25 class PaymentRequestSpec; 33 class PaymentRequestSpec;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // recomputing "is ready to pay" and notify observers. 121 // recomputing "is ready to pay" and notify observers.
114 void SetSelectedShippingOption(const std::string& shipping_option_id); 122 void SetSelectedShippingOption(const std::string& shipping_option_id);
115 void SetSelectedShippingProfile(autofill::AutofillProfile* profile); 123 void SetSelectedShippingProfile(autofill::AutofillProfile* profile);
116 void SetSelectedContactProfile(autofill::AutofillProfile* profile); 124 void SetSelectedContactProfile(autofill::AutofillProfile* profile);
117 void SetSelectedInstrument(PaymentInstrument* instrument); 125 void SetSelectedInstrument(PaymentInstrument* instrument);
118 126
119 bool is_ready_to_pay() { return is_ready_to_pay_; } 127 bool is_ready_to_pay() { return is_ready_to_pay_; }
120 128
121 const std::string& GetApplicationLocale(); 129 const std::string& GetApplicationLocale();
122 autofill::PersonalDataManager* GetPersonalDataManager(); 130 autofill::PersonalDataManager* GetPersonalDataManager();
131 std::unique_ptr<const ::i18n::addressinput::Source> GetAddressInputSource();
132 std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage();
123 133
124 Delegate* delegate() { return delegate_; } 134 Delegate* delegate() { return delegate_; }
125 135
126 private: 136 private:
127 // Fetches the Autofill Profiles for this user from the PersonalDataManager, 137 // Fetches the Autofill Profiles for this user from the PersonalDataManager,
128 // and stores copies of them, owned by this PaymentRequestState, in 138 // and stores copies of them, owned by this PaymentRequestState, in
129 // profile_cache_. 139 // profile_cache_.
130 void PopulateProfileCache(); 140 void PopulateProfileCache();
131 141
132 // Sets the initial selections for instruments and profiles, and notifies 142 // Sets the initial selections for instruments and profiles, and notifies
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 std::unique_ptr<PaymentResponseHelper> response_helper_; 185 std::unique_ptr<PaymentResponseHelper> response_helper_;
176 186
177 base::ObserverList<Observer> observers_; 187 base::ObserverList<Observer> observers_;
178 188
179 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState); 189 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState);
180 }; 190 };
181 191
182 } // namespace payments 192 } // namespace payments
183 193
184 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ 194 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698