OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_GENERAL_PAGE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ |
6 #define CHROME_BROWSER_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_OPTIONS_GENERAL_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/browser/views/shelf_item_dialog.h" | 9 #include "chrome/browser/views/shelf_item_dialog.h" |
10 #include "chrome/common/pref_member.h" | 10 #include "chrome/common/pref_member.h" |
11 #include "views/controls/combo_box.h" | 11 #include "views/controls/combo_box.h" |
12 #include "views/controls/button/button.h" | 12 #include "views/controls/button/button.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 GroupboxView; | 17 class GroupboxView; |
18 class Label; | 18 class Label; |
19 class NativeButton; | 19 class NativeButton; |
20 class RadioButton; | 20 class RadioButton; |
21 class TableModel; | 21 class TableModel; |
22 class TableView; | 22 class TableView; |
23 class TextField; | 23 class Textfield; |
24 } | 24 } |
25 class CustomHomePagesTableModel; | 25 class CustomHomePagesTableModel; |
26 class OptionsGroupView; | 26 class OptionsGroupView; |
27 class SearchEngineListModel; | 27 class SearchEngineListModel; |
28 | 28 |
29 /////////////////////////////////////////////////////////////////////////////// | 29 /////////////////////////////////////////////////////////////////////////////// |
30 // GeneralPageView | 30 // GeneralPageView |
31 | 31 |
32 class GeneralPageView : public OptionsPageView, | 32 class GeneralPageView : public OptionsPageView, |
33 public views::ComboBox::Listener, | 33 public views::ComboBox::Listener, |
34 public views::ButtonListener, | 34 public views::ButtonListener, |
35 public views::TextField::Controller, | 35 public views::Textfield::Controller, |
36 public ShelfItemDialogDelegate, | 36 public ShelfItemDialogDelegate, |
37 public views::TableViewObserver { | 37 public views::TableViewObserver { |
38 public: | 38 public: |
39 explicit GeneralPageView(Profile* profile); | 39 explicit GeneralPageView(Profile* profile); |
40 virtual ~GeneralPageView(); | 40 virtual ~GeneralPageView(); |
41 | 41 |
42 protected: | 42 protected: |
43 // views::ButtonListener implementation: | 43 // views::ButtonListener implementation: |
44 virtual void ButtonPressed(views::Button* sender); | 44 virtual void ButtonPressed(views::Button* sender); |
45 | 45 |
46 // views::ComboBox::Listener implementation: | 46 // views::ComboBox::Listener implementation: |
47 virtual void ItemChanged(views::ComboBox* combo_box, | 47 virtual void ItemChanged(views::ComboBox* combo_box, |
48 int prev_index, | 48 int prev_index, |
49 int new_index); | 49 int new_index); |
50 | 50 |
51 // views::TextField::Controller implementation: | 51 // views::Textfield::Controller implementation: |
52 virtual void ContentsChanged(views::TextField* sender, | 52 virtual void ContentsChanged(views::Textfield* sender, |
53 const std::wstring& new_contents); | 53 const std::wstring& new_contents); |
54 virtual bool HandleKeystroke(views::TextField* sender, | 54 virtual bool HandleKeystroke(views::Textfield* sender, |
55 const views::TextField::Keystroke& key); | 55 const views::Textfield::Keystroke& key); |
56 | 56 |
57 // OptionsPageView implementation: | 57 // OptionsPageView implementation: |
58 virtual void InitControlLayout(); | 58 virtual void InitControlLayout(); |
59 virtual void NotifyPrefChanged(const std::wstring* pref_name); | 59 virtual void NotifyPrefChanged(const std::wstring* pref_name); |
60 virtual void HighlightGroup(OptionsGroup highlight_group); | 60 virtual void HighlightGroup(OptionsGroup highlight_group); |
61 | 61 |
62 // views::View overrides: | 62 // views::View overrides: |
63 virtual void Layout(); | 63 virtual void Layout(); |
64 | 64 |
65 private: | 65 private: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 views::NativeButton* startup_add_custom_page_button_; | 125 views::NativeButton* startup_add_custom_page_button_; |
126 views::NativeButton* startup_remove_custom_page_button_; | 126 views::NativeButton* startup_remove_custom_page_button_; |
127 views::NativeButton* startup_use_current_page_button_; | 127 views::NativeButton* startup_use_current_page_button_; |
128 views::TableView* startup_custom_pages_table_; | 128 views::TableView* startup_custom_pages_table_; |
129 scoped_ptr<CustomHomePagesTableModel> startup_custom_pages_table_model_; | 129 scoped_ptr<CustomHomePagesTableModel> startup_custom_pages_table_model_; |
130 | 130 |
131 // Controls for the Home Page group | 131 // Controls for the Home Page group |
132 OptionsGroupView* homepage_group_; | 132 OptionsGroupView* homepage_group_; |
133 views::RadioButton* homepage_use_newtab_radio_; | 133 views::RadioButton* homepage_use_newtab_radio_; |
134 views::RadioButton* homepage_use_url_radio_; | 134 views::RadioButton* homepage_use_url_radio_; |
135 views::TextField* homepage_use_url_textfield_; | 135 views::Textfield* homepage_use_url_textfield_; |
136 views::Checkbox* homepage_show_home_button_checkbox_; | 136 views::Checkbox* homepage_show_home_button_checkbox_; |
137 BooleanPrefMember new_tab_page_is_home_page_; | 137 BooleanPrefMember new_tab_page_is_home_page_; |
138 StringPrefMember homepage_; | 138 StringPrefMember homepage_; |
139 BooleanPrefMember show_home_button_; | 139 BooleanPrefMember show_home_button_; |
140 | 140 |
141 // Controls for the Default Search group | 141 // Controls for the Default Search group |
142 OptionsGroupView* default_search_group_; | 142 OptionsGroupView* default_search_group_; |
143 views::ComboBox* default_search_engine_combobox_; | 143 views::ComboBox* default_search_engine_combobox_; |
144 views::NativeButton* default_search_manage_engines_button_; | 144 views::NativeButton* default_search_manage_engines_button_; |
145 scoped_ptr<SearchEngineListModel> default_search_engines_model_; | 145 scoped_ptr<SearchEngineListModel> default_search_engines_model_; |
146 | 146 |
147 // Controls for the Default Browser group | 147 // Controls for the Default Browser group |
148 OptionsGroupView* default_browser_group_; | 148 OptionsGroupView* default_browser_group_; |
149 views::Label* default_browser_status_label_; | 149 views::Label* default_browser_status_label_; |
150 views::NativeButton* default_browser_use_as_default_button_; | 150 views::NativeButton* default_browser_use_as_default_button_; |
151 | 151 |
152 // The helper object that performs default browser set/check tasks. | 152 // The helper object that performs default browser set/check tasks. |
153 class DefaultBrowserWorker; | 153 class DefaultBrowserWorker; |
154 friend DefaultBrowserWorker; | 154 friend DefaultBrowserWorker; |
155 scoped_refptr<DefaultBrowserWorker> default_browser_worker_; | 155 scoped_refptr<DefaultBrowserWorker> default_browser_worker_; |
156 | 156 |
157 DISALLOW_COPY_AND_ASSIGN(GeneralPageView); | 157 DISALLOW_COPY_AND_ASSIGN(GeneralPageView); |
158 }; | 158 }; |
159 | 159 |
160 #endif // CHROME_BROWSER_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ | 160 #endif // CHROME_BROWSER_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ |
OLD | NEW |