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

Side by Side Diff: chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h

Issue 2951743002: Merge-60[Payments] Make state combobox def. value work with state abbrv. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER _H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER _H_
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER _H_ 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER _H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "chrome/browser/ui/views/payments/editor_view_controller.h" 15 #include "chrome/browser/ui/views/payments/editor_view_controller.h"
16 #include "chrome/browser/ui/views/payments/validating_textfield.h" 16 #include "chrome/browser/ui/views/payments/validating_textfield.h"
17 #include "components/autofill/core/browser/region_combobox_model.h"
17 18
18 namespace autofill { 19 namespace autofill {
19 class AutofillProfile; 20 class AutofillProfile;
20 class CountryComboboxModel; 21 class CountryComboboxModel;
21 } // namespace autofill 22 } // namespace autofill
22 23
23 namespace payments { 24 namespace payments {
24 25
25 class PaymentRequestSpec; 26 class PaymentRequestSpec;
26 class PaymentRequestState; 27 class PaymentRequestState;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // |chosen_country_index_|. 120 // |chosen_country_index_|.
120 size_t chosen_country_index_; 121 size_t chosen_country_index_;
121 122
122 // The list of country codes and names as ordered in the country combobox 123 // The list of country codes and names as ordered in the country combobox
123 // model. 124 // model.
124 std::vector<std::pair<std::string, base::string16>> countries_; 125 std::vector<std::pair<std::string, base::string16>> countries_;
125 126
126 // Identifies whether we tried and failed to load region data. 127 // Identifies whether we tried and failed to load region data.
127 bool failed_to_load_region_data_; 128 bool failed_to_load_region_data_;
128 129
130 // Owned by the state combobox, which is owned by this object's base class.
131 autofill::RegionComboboxModel* region_model_;
132
129 // Updates |countries_| with the content of |model| if it's not null, 133 // Updates |countries_| with the content of |model| if it's not null,
130 // otherwise use a local model. 134 // otherwise use a local model.
131 void UpdateCountries(autofill::CountryComboboxModel* model); 135 void UpdateCountries(autofill::CountryComboboxModel* model);
132 136
133 // Updates |editor_fields_| based on the current country. 137 // Updates |editor_fields_| based on the current country.
134 void UpdateEditorFields(); 138 void UpdateEditorFields();
135 139
136 // Called when data changes need to force a view update. |synchronous| 140 // Called when data changes need to force a view update. |synchronous|
137 // specifies whether the view update can be done synchronously. 141 // specifies whether the view update can be done synchronously.
138 void OnDataChanged(bool synchronous); 142 void OnDataChanged(bool synchronous);
139 143
140 // Saves the current state of the |editor_fields_| in |profile| and ignore 144 // Saves the current state of the |editor_fields_| in |profile| and ignore
141 // errors if |ignore_errors| is true. Return false on errors, ignored or not. 145 // errors if |ignore_errors| is true. Return false on errors, ignored or not.
142 bool SaveFieldsToProfile(autofill::AutofillProfile* profile, 146 bool SaveFieldsToProfile(autofill::AutofillProfile* profile,
143 bool ignore_errors); 147 bool ignore_errors);
144 148
145 // When a combobox model has changed, a view update might be needed, e.g., if 149 // When a combobox model has changed, a view update might be needed, e.g., if
146 // there is no data in the combobox and it must be converted to a text field. 150 // there is no data in the combobox and it must be converted to a text field.
147 void OnComboboxModelChanged(views::Combobox* combobox); 151 void OnComboboxModelChanged(views::Combobox* combobox);
148 152
149 // Failed to fetch the region data in time. 153 // Failed to fetch the region data in time.
150 void RegionDataLoadTimedOut(); 154 void RegionDataLoadTimedOut();
151 155
152 DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController); 156 DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController);
153 }; 157 };
154 158
155 } // namespace payments 159 } // namespace payments
156 160
157 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROL LER_H_ 161 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROL LER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698