| 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 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 public: | 186 public: |
| 187 PhoneSubView(AutoFillProfilesView* autofill_view, | 187 PhoneSubView(AutoFillProfilesView* autofill_view, |
| 188 views::Label* label, | 188 views::Label* label, |
| 189 views::Textfield* text_phone); | 189 views::Textfield* text_phone); |
| 190 virtual ~PhoneSubView() {} | 190 virtual ~PhoneSubView() {} |
| 191 | 191 |
| 192 virtual void ContentsChanged(views::Textfield* sender, | 192 virtual void ContentsChanged(views::Textfield* sender, |
| 193 const string16& new_contents); | 193 const string16& new_contents); |
| 194 | 194 |
| 195 bool IsValid() const; | 195 bool IsValid() const; |
| 196 |
| 196 protected: | 197 protected: |
| 197 // views::View methods: | 198 // views::View methods: |
| 198 virtual void ViewHierarchyChanged(bool is_add, views::View* parent, | 199 virtual void ViewHierarchyChanged(bool is_add, views::View* parent, |
| 199 views::View* child); | 200 views::View* child); |
| 200 | 201 |
| 201 // public views::ButtonListener method: | 202 // public views::ButtonListener method: |
| 202 virtual void ButtonPressed(views::Button* sender, | 203 virtual void ButtonPressed(views::Button* sender, |
| 203 const views::Event& event) { | 204 const views::Event& event) { |
| 204 // Only stub is needed, it is never called. | 205 // Only stub is needed, it is never called. |
| 205 NOTREACHED(); | 206 NOTREACHED(); |
| 206 } | 207 } |
| 208 |
| 207 private: | 209 private: |
| 208 void UpdateButtons(); | 210 void UpdateButtons(); |
| 209 AutoFillProfilesView* autofill_view_; | 211 AutoFillProfilesView* autofill_view_; |
| 210 views::Label* label_; | 212 views::Label* label_; |
| 211 views::Textfield* text_phone_; | 213 views::Textfield* text_phone_; |
| 212 views::ImageButton* phone_warning_button_; | 214 views::ImageButton* phone_warning_button_; |
| 213 bool last_state_; | 215 bool last_state_; |
| 214 | 216 |
| 215 DISALLOW_COPY_AND_ASSIGN(PhoneSubView); | 217 DISALLOW_COPY_AND_ASSIGN(PhoneSubView); |
| 216 }; | 218 }; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 | 387 |
| 386 // Return the number of items in the combo box. | 388 // Return the number of items in the combo box. |
| 387 virtual int GetItemCount(); | 389 virtual int GetItemCount(); |
| 388 | 390 |
| 389 // Return the string that should be used to represent a given item. | 391 // Return the string that should be used to represent a given item. |
| 390 virtual std::wstring GetItemAt(int index); | 392 virtual std::wstring GetItemAt(int index); |
| 391 | 393 |
| 392 // Find an index of the item in the model, -1 if not present. | 394 // Find an index of the item in the model, -1 if not present. |
| 393 int GetIndex(const std::wstring& value); | 395 int GetIndex(const std::wstring& value); |
| 394 | 396 |
| 395 protected: | |
| 396 private: | 397 private: |
| 397 std::vector<std::wstring> cb_strings_; | 398 std::vector<std::wstring> cb_strings_; |
| 398 | 399 |
| 399 DISALLOW_COPY_AND_ASSIGN(StringVectorComboboxModel); | 400 DISALLOW_COPY_AND_ASSIGN(StringVectorComboboxModel); |
| 400 }; | 401 }; |
| 401 | 402 |
| 402 | 403 |
| 403 // Model for scrolling credit cards and addresses | 404 // Model for scrolling credit cards and addresses |
| 404 class ContentListTableModel : public TableModel { | 405 class ContentListTableModel : public TableModel { |
| 405 public: | 406 public: |
| 406 ContentListTableModel(std::vector<EditableSetInfo>* profiles, | 407 ContentListTableModel(std::vector<EditableSetInfo>* profiles, |
| 407 std::vector<EditableSetInfo>* credit_cards); | 408 std::vector<EditableSetInfo>* credit_cards); |
| 408 virtual ~ContentListTableModel() {} | 409 virtual ~ContentListTableModel() {} |
| 409 | 410 |
| 410 // Two constants defined for indexes of groups. The first one is index | 411 // Two constants defined for indexes of groups. The first one is index |
| 411 // of Add Address button, the second one is the index of Add Credit Card | 412 // of Add Address button, the second one is the index of Add Credit Card |
| 412 // button. | 413 // button. |
| 413 static const int kAddressGroup = 1; | 414 static const int kAddressGroup = 1; |
| 414 static const int kCreditCardGroup = 2; | 415 static const int kCreditCardGroup = 2; |
| 415 | 416 |
| 416 void Refresh(); | 417 void Refresh(); |
| 417 void AddItem(int index); | 418 void AddItem(int index); |
| 418 void RemoveItem(int index); | 419 void RemoveItem(int index); |
| 419 void UpdateItem(int index); | 420 void UpdateItem(int index); |
| 420 | 421 |
| 421 protected: | |
| 422 | |
| 423 // TableModel members: | 422 // TableModel members: |
| 424 virtual int RowCount(); | 423 virtual int RowCount(); |
| 425 virtual std::wstring GetText(int row, int column_id); | 424 virtual std::wstring GetText(int row, int column_id); |
| 426 virtual bool HasGroups() { return true; } | 425 virtual bool HasGroups() { return true; } |
| 427 virtual TableModel::Groups GetGroups(); | 426 virtual TableModel::Groups GetGroups(); |
| 428 virtual int GetGroupID(int row); | 427 virtual int GetGroupID(int row); |
| 429 virtual void SetObserver(TableModelObserver* observer); | 428 virtual void SetObserver(TableModelObserver* observer); |
| 430 | 429 |
| 431 private: | 430 private: |
| 432 std::vector<EditableSetInfo>* profiles_; | 431 std::vector<EditableSetInfo>* profiles_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 453 views::FocusManager* focus_manager_; | 452 views::FocusManager* focus_manager_; |
| 454 bool child_dialog_opened_; | 453 bool child_dialog_opened_; |
| 455 | 454 |
| 456 static AutoFillProfilesView* instance_; | 455 static AutoFillProfilesView* instance_; |
| 457 | 456 |
| 458 DISALLOW_COPY_AND_ASSIGN(AutoFillProfilesView); | 457 DISALLOW_COPY_AND_ASSIGN(AutoFillProfilesView); |
| 459 }; | 458 }; |
| 460 | 459 |
| 461 #endif // CHROME_BROWSER_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ | 460 #endif // CHROME_BROWSER_VIEWS_AUTOFILL_PROFILES_VIEW_WIN_H_ |
| 462 | 461 |
| OLD | NEW |