| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ |
| 6 #define CHROME_BROWSER_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ | 6 #define CHROME_BROWSER_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 virtual void Observe(NotificationType type, | 148 virtual void Observe(NotificationType type, |
| 149 const NotificationSource& source, | 149 const NotificationSource& source, |
| 150 const NotificationDetails& details); | 150 const NotificationDetails& details); |
| 151 | 151 |
| 152 // Helper structure to keep info on one address or credit card. | 152 // Helper structure to keep info on one address or credit card. |
| 153 // Keeps info on one item in EditableSetViewContents. | 153 // Keeps info on one item in EditableSetViewContents. |
| 154 // Also keeps info on opened status. Allows to quickly add and delete items, | 154 // Also keeps info on opened status. Allows to quickly add and delete items, |
| 155 // and then rebuild EditableSetViewContents. | 155 // and then rebuild EditableSetViewContents. |
| 156 struct EditableSetInfo { | 156 struct EditableSetInfo { |
| 157 bool is_address; | 157 bool is_address; |
| 158 bool has_credit_card_number_been_edited; | |
| 159 // If |is_address| is true |address| has some data and |credit_card| | 158 // If |is_address| is true |address| has some data and |credit_card| |
| 160 // is empty, and vice versa | 159 // is empty, and vice versa |
| 161 AutoFillProfile address; | 160 AutoFillProfile address; |
| 162 CreditCard credit_card; | 161 CreditCard credit_card; |
| 163 | 162 |
| 164 explicit EditableSetInfo(const AutoFillProfile* input_address) | 163 explicit EditableSetInfo(const AutoFillProfile* input_address) |
| 165 : address(*input_address), | 164 : address(*input_address), |
| 166 is_address(true), | 165 is_address(true) { |
| 167 has_credit_card_number_been_edited(false) { | |
| 168 } | 166 } |
| 169 explicit EditableSetInfo(const CreditCard* input_credit_card) | 167 explicit EditableSetInfo(const CreditCard* input_credit_card) |
| 170 : credit_card(*input_credit_card), | 168 : credit_card(*input_credit_card), |
| 171 is_address(false), | 169 is_address(false) { |
| 172 has_credit_card_number_been_edited(false) { | |
| 173 } | 170 } |
| 174 }; | 171 }; |
| 175 | 172 |
| 176 private: | 173 private: |
| 177 // Indicates that there was no item focused. After re-building of the lists | 174 // Indicates that there was no item focused. After re-building of the lists |
| 178 // first item will be focused. | 175 // first item will be focused. |
| 179 static const int kNoItemFocused = -1; | 176 static const int kNoItemFocused = -1; |
| 180 | 177 |
| 181 struct FocusedItem { | 178 struct FocusedItem { |
| 182 int group; | 179 int group; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // If |field| is a phone or fax ContentsChanged is passed to the | 319 // If |field| is a phone or fax ContentsChanged is passed to the |
| 323 // PhoneSubView, the appropriate fields in |temporary_info_| are updated and | 320 // PhoneSubView, the appropriate fields in |temporary_info_| are updated and |
| 324 // true is returned. Otherwise false is returned. | 321 // true is returned. Otherwise false is returned. |
| 325 bool UpdateContentsPhoneViews(TextFields field, | 322 bool UpdateContentsPhoneViews(TextFields field, |
| 326 views::Textfield* sender, | 323 views::Textfield* sender, |
| 327 const string16& new_contents); | 324 const string16& new_contents); |
| 328 | 325 |
| 329 views::Textfield* text_fields_[MAX_TEXT_FIELD]; | 326 views::Textfield* text_fields_[MAX_TEXT_FIELD]; |
| 330 std::vector<EditableSetInfo>::iterator editable_fields_set_; | 327 std::vector<EditableSetInfo>::iterator editable_fields_set_; |
| 331 EditableSetInfo temporary_info_; | 328 EditableSetInfo temporary_info_; |
| 329 bool has_credit_card_number_been_edited_; |
| 332 AutoFillProfilesView* observer_; | 330 AutoFillProfilesView* observer_; |
| 333 AddressComboBoxModel* billing_model_; | 331 AddressComboBoxModel* billing_model_; |
| 334 views::Combobox* combo_box_billing_; | 332 views::Combobox* combo_box_billing_; |
| 335 scoped_ptr<StringVectorComboboxModel> combo_box_model_month_; | 333 scoped_ptr<StringVectorComboboxModel> combo_box_model_month_; |
| 336 views::Combobox* combo_box_month_; | 334 views::Combobox* combo_box_month_; |
| 337 scoped_ptr<StringVectorComboboxModel> combo_box_model_year_; | 335 scoped_ptr<StringVectorComboboxModel> combo_box_model_year_; |
| 338 views::Combobox* combo_box_year_; | 336 views::Combobox* combo_box_year_; |
| 339 bool new_item_; | 337 bool new_item_; |
| 340 std::vector<PhoneSubView*> phone_sub_views_; | 338 std::vector<PhoneSubView*> phone_sub_views_; |
| 341 | 339 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 scoped_ptr<ContentListTableModel> table_model_; | 470 scoped_ptr<ContentListTableModel> table_model_; |
| 473 views::FocusManager* focus_manager_; | 471 views::FocusManager* focus_manager_; |
| 474 bool child_dialog_opened_; | 472 bool child_dialog_opened_; |
| 475 | 473 |
| 476 static AutoFillProfilesView* instance_; | 474 static AutoFillProfilesView* instance_; |
| 477 | 475 |
| 478 DISALLOW_COPY_AND_ASSIGN(AutoFillProfilesView); | 476 DISALLOW_COPY_AND_ASSIGN(AutoFillProfilesView); |
| 479 }; | 477 }; |
| 480 | 478 |
| 481 #endif // CHROME_BROWSER_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ | 479 #endif // CHROME_BROWSER_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ |
| OLD | NEW |