| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_OPTIONS_LANGUAGES_PAGE_VIEW_H__ | 5 #ifndef CHROME_BROWSER_VIEWS_OPTIONS_LANGUAGES_PAGE_VIEW_H__ |
| 6 #define CHROME_BROWSER_VIEWS_OPTIONS_LANGUAGES_PAGE_VIEW_H__ | 6 #define CHROME_BROWSER_VIEWS_OPTIONS_LANGUAGES_PAGE_VIEW_H__ |
| 7 | 7 |
| 8 #include "chrome/browser/views/options/options_page_view.h" | 8 #include "chrome/browser/views/options/options_page_view.h" |
| 9 #include "chrome/common/pref_member.h" | 9 #include "chrome/common/pref_member.h" |
| 10 #include "views/controls/combo_box.h" | 10 #include "views/controls/combobox/combobox.h" |
| 11 #include "views/controls/button/button.h" | 11 #include "views/controls/button/button.h" |
| 12 #include "views/controls/table/table_view_observer.h" | 12 #include "views/controls/table/table_view_observer.h" |
| 13 #include "views/view.h" | 13 #include "views/view.h" |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 class Checkbox; | 16 class Checkbox; |
| 17 class Label; | 17 class Label; |
| 18 class NativeButton; | 18 class NativeButton; |
| 19 class TableModel; | 19 class TableModel; |
| 20 class TableView; | 20 class TableView; |
| 21 } | 21 } |
| 22 | 22 |
| 23 class LanguageComboboxModel; | 23 class LanguageComboboxModel; |
| 24 class LanguageOrderTableModel; | 24 class LanguageOrderTableModel; |
| 25 class AddLanguageView; | 25 class AddLanguageView; |
| 26 | 26 |
| 27 /////////////////////////////////////////////////////////////////////////////// | 27 /////////////////////////////////////////////////////////////////////////////// |
| 28 // LanguagesPageView | 28 // LanguagesPageView |
| 29 | 29 |
| 30 class LanguagesPageView : public OptionsPageView, | 30 class LanguagesPageView : public OptionsPageView, |
| 31 public views::ButtonListener, | 31 public views::ButtonListener, |
| 32 public views::TableViewObserver, | 32 public views::TableViewObserver, |
| 33 public views::ComboBox::Listener { | 33 public views::Combobox::Listener { |
| 34 public: | 34 public: |
| 35 explicit LanguagesPageView(Profile* profile); | 35 explicit LanguagesPageView(Profile* profile); |
| 36 virtual ~LanguagesPageView(); | 36 virtual ~LanguagesPageView(); |
| 37 | 37 |
| 38 // views::ButtonListener implementation: | 38 // views::ButtonListener implementation: |
| 39 virtual void ButtonPressed(views::Button* sender); | 39 virtual void ButtonPressed(views::Button* sender); |
| 40 | 40 |
| 41 // Save Changes made to relevant pref members associated with this tab. | 41 // Save Changes made to relevant pref members associated with this tab. |
| 42 // This is public since it is called by FontsLanguageWindowView in its | 42 // This is public since it is called by FontsLanguageWindowView in its |
| 43 // Dialog Delegate Accept() method. | 43 // Dialog Delegate Accept() method. |
| 44 void SaveChanges(); | 44 void SaveChanges(); |
| 45 | 45 |
| 46 // This is public because when user clicks OK in AddLanguageView dialog, | 46 // This is public because when user clicks OK in AddLanguageView dialog, |
| 47 // this is called back in the LanguagePageView delegate in order to add | 47 // this is called back in the LanguagePageView delegate in order to add |
| 48 // this language to the table model in this tab. | 48 // this language to the table model in this tab. |
| 49 void OnAddLanguage(const std::string& new_language); | 49 void OnAddLanguage(const std::string& new_language); |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 // OptionsPageView implementation: | 52 // OptionsPageView implementation: |
| 53 virtual void InitControlLayout(); | 53 virtual void InitControlLayout(); |
| 54 virtual void NotifyPrefChanged(const std::wstring* pref_name); | 54 virtual void NotifyPrefChanged(const std::wstring* pref_name); |
| 55 | 55 |
| 56 // views::ComboBox::Listener implementation: | 56 // views::Combobox::Listener implementation: |
| 57 virtual void ItemChanged(views::ComboBox* sender, | 57 virtual void ItemChanged(views::Combobox* sender, |
| 58 int prev_index, | 58 int prev_index, |
| 59 int new_index); | 59 int new_index); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 // Invoked when the selection of the table view changes. Updates the enabled | 62 // Invoked when the selection of the table view changes. Updates the enabled |
| 63 // property of the remove button. | 63 // property of the remove button. |
| 64 virtual void OnSelectionChanged(); | 64 virtual void OnSelectionChanged(); |
| 65 void OnRemoveLanguage(); | 65 void OnRemoveLanguage(); |
| 66 void OnMoveDownLanguage(); | 66 void OnMoveDownLanguage(); |
| 67 void OnMoveUpLanguage(); | 67 void OnMoveUpLanguage(); |
| 68 | 68 |
| 69 views::Label* languages_instructions_; | 69 views::Label* languages_instructions_; |
| 70 views::View* languages_contents_; | 70 views::View* languages_contents_; |
| 71 views::View* button_stack_; | 71 views::View* button_stack_; |
| 72 views::TableView* language_order_table_; | 72 views::TableView* language_order_table_; |
| 73 views::NativeButton* move_up_button_; | 73 views::NativeButton* move_up_button_; |
| 74 views::NativeButton* move_down_button_; | 74 views::NativeButton* move_down_button_; |
| 75 views::NativeButton* add_button_; | 75 views::NativeButton* add_button_; |
| 76 views::NativeButton* remove_button_; | 76 views::NativeButton* remove_button_; |
| 77 views::Label* language_info_label_; | 77 views::Label* language_info_label_; |
| 78 views::Label* ui_language_label_; | 78 views::Label* ui_language_label_; |
| 79 views::ComboBox* change_ui_language_combobox_; | 79 views::Combobox* change_ui_language_combobox_; |
| 80 views::ComboBox* change_dictionary_language_combobox_; | 80 views::Combobox* change_dictionary_language_combobox_; |
| 81 views::Checkbox* enable_spellchecking_checkbox_; | 81 views::Checkbox* enable_spellchecking_checkbox_; |
| 82 views::Label* dictionary_language_label_; | 82 views::Label* dictionary_language_label_; |
| 83 | 83 |
| 84 scoped_ptr<LanguageOrderTableModel> language_order_table_model_; | 84 scoped_ptr<LanguageOrderTableModel> language_order_table_model_; |
| 85 AddLanguageView* add_language_instance_; | 85 AddLanguageView* add_language_instance_; |
| 86 StringPrefMember accept_languages_; | 86 StringPrefMember accept_languages_; |
| 87 | 87 |
| 88 // The contents of the "user interface language" combobox. | 88 // The contents of the "user interface language" combobox. |
| 89 scoped_ptr<LanguageComboboxModel> ui_language_model_; | 89 scoped_ptr<LanguageComboboxModel> ui_language_model_; |
| 90 StringPrefMember app_locale_; | 90 StringPrefMember app_locale_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 104 std::string spellcheck_language_added_; | 104 std::string spellcheck_language_added_; |
| 105 | 105 |
| 106 bool language_table_edited_; | 106 bool language_table_edited_; |
| 107 bool language_warning_shown_; | 107 bool language_warning_shown_; |
| 108 bool enable_spellcheck_checkbox_clicked_; | 108 bool enable_spellcheck_checkbox_clicked_; |
| 109 | 109 |
| 110 DISALLOW_EVIL_CONSTRUCTORS(LanguagesPageView); | 110 DISALLOW_EVIL_CONSTRUCTORS(LanguagesPageView); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 #endif // CHROME_BROWSER_VIEWS_OPTIONS_LANGUAGES_PAGE_VIEW_H__ | 113 #endif // CHROME_BROWSER_VIEWS_OPTIONS_LANGUAGES_PAGE_VIEW_H__ |
| OLD | NEW |