| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/prefs/pref_change_registrar.h" | 9 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 10 #include "chrome/browser/prefs/pref_member.h" | 10 #include "chrome/browser/prefs/pref_member.h" |
| 11 #include "chrome/browser/shell_integration.h" | 11 #include "chrome/browser/shell_integration.h" |
| 12 #include "chrome/browser/views/options/options_page_view.h" | 12 #include "chrome/browser/views/options/options_page_view.h" |
| 13 #include "chrome/browser/views/url_picker.h" | 13 #include "chrome/browser/views/url_picker.h" |
| 14 #include "views/controls/combobox/combobox.h" | 14 #include "views/controls/combobox/combobox.h" |
| 15 #include "views/controls/button/button.h" | 15 #include "views/controls/button/button.h" |
| 16 #include "views/controls/link.h" | |
| 17 #include "views/controls/table/table_view_observer.h" | 16 #include "views/controls/table/table_view_observer.h" |
| 18 #include "views/view.h" | 17 #include "views/view.h" |
| 19 | 18 |
| 20 namespace views { | 19 namespace views { |
| 21 class Checkbox; | 20 class Checkbox; |
| 22 class GroupboxView; | 21 class GroupboxView; |
| 23 class Label; | 22 class Label; |
| 24 class NativeButton; | 23 class NativeButton; |
| 25 class RadioButton; | 24 class RadioButton; |
| 26 class TableView; | 25 class TableView; |
| 27 class Textfield; | 26 class Textfield; |
| 28 } | 27 } |
| 29 class CustomHomePagesTableModel; | 28 class CustomHomePagesTableModel; |
| 30 class OptionsGroupView; | 29 class OptionsGroupView; |
| 31 class SearchEngineListModel; | 30 class SearchEngineListModel; |
| 32 class TableModel; | 31 class TableModel; |
| 33 | 32 |
| 34 /////////////////////////////////////////////////////////////////////////////// | 33 /////////////////////////////////////////////////////////////////////////////// |
| 35 // GeneralPageView | 34 // GeneralPageView |
| 36 | 35 |
| 37 class GeneralPageView : public OptionsPageView, | 36 class GeneralPageView : public OptionsPageView, |
| 38 public views::Combobox::Listener, | 37 public views::Combobox::Listener, |
| 39 public views::ButtonListener, | 38 public views::ButtonListener, |
| 40 public views::Textfield::Controller, | 39 public views::Textfield::Controller, |
| 41 public UrlPickerDelegate, | 40 public UrlPickerDelegate, |
| 42 public views::TableViewObserver, | 41 public views::TableViewObserver, |
| 43 public ShellIntegration::DefaultBrowserObserver, | 42 public ShellIntegration::DefaultBrowserObserver { |
| 44 public views::LinkController { | |
| 45 public: | 43 public: |
| 46 explicit GeneralPageView(Profile* profile); | 44 explicit GeneralPageView(Profile* profile); |
| 47 virtual ~GeneralPageView(); | 45 virtual ~GeneralPageView(); |
| 48 | 46 |
| 49 protected: | 47 protected: |
| 50 // views::ButtonListener implementation: | 48 // views::ButtonListener implementation: |
| 51 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 49 virtual void ButtonPressed(views::Button* sender, const views::Event& event); |
| 52 | 50 |
| 53 // views::Combobox::Listener implementation: | 51 // views::Combobox::Listener implementation: |
| 54 virtual void ItemChanged(views::Combobox* combobox, | 52 virtual void ItemChanged(views::Combobox* combobox, |
| 55 int prev_index, | 53 int prev_index, |
| 56 int new_index); | 54 int new_index); |
| 57 | 55 |
| 58 // views::Textfield::Controller implementation: | 56 // views::Textfield::Controller implementation: |
| 59 virtual void ContentsChanged(views::Textfield* sender, | 57 virtual void ContentsChanged(views::Textfield* sender, |
| 60 const std::wstring& new_contents); | 58 const std::wstring& new_contents); |
| 61 virtual bool HandleKeystroke(views::Textfield* sender, | 59 virtual bool HandleKeystroke(views::Textfield* sender, |
| 62 const views::Textfield::Keystroke& key); | 60 const views::Textfield::Keystroke& key); |
| 63 | 61 |
| 64 // OptionsPageView implementation: | 62 // OptionsPageView implementation: |
| 65 virtual void InitControlLayout(); | 63 virtual void InitControlLayout(); |
| 66 virtual void NotifyPrefChanged(const std::string* pref_name); | 64 virtual void NotifyPrefChanged(const std::string* pref_name); |
| 67 virtual void HighlightGroup(OptionsGroup highlight_group); | 65 virtual void HighlightGroup(OptionsGroup highlight_group); |
| 68 | 66 |
| 69 // LinkController implementation: | |
| 70 virtual void LinkActivated(views::Link* source, int event_flags); | |
| 71 | |
| 72 private: | 67 private: |
| 73 // ShellIntegration::DefaultBrowserObserver implementation: | 68 // ShellIntegration::DefaultBrowserObserver implementation: |
| 74 // Updates the UI state to reflect the current default browser state. | 69 // Updates the UI state to reflect the current default browser state. |
| 75 virtual void SetDefaultBrowserUIState( | 70 virtual void SetDefaultBrowserUIState( |
| 76 ShellIntegration::DefaultBrowserUIState state); | 71 ShellIntegration::DefaultBrowserUIState state); |
| 77 | 72 |
| 78 // For Side by Side installs, this will disable the Default Browser setting | 73 // For Side by Side installs, this will disable the Default Browser setting |
| 79 // and display an explanitory message. | 74 // and display an explanitory message. |
| 80 void SetDefaultBrowserUIStateForSxS(); | 75 void SetDefaultBrowserUIStateForSxS(); |
| 81 | 76 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // Controls for the Home Page group | 136 // Controls for the Home Page group |
| 142 OptionsGroupView* homepage_group_; | 137 OptionsGroupView* homepage_group_; |
| 143 views::RadioButton* homepage_use_newtab_radio_; | 138 views::RadioButton* homepage_use_newtab_radio_; |
| 144 views::RadioButton* homepage_use_url_radio_; | 139 views::RadioButton* homepage_use_url_radio_; |
| 145 views::Textfield* homepage_use_url_textfield_; | 140 views::Textfield* homepage_use_url_textfield_; |
| 146 views::Checkbox* homepage_show_home_button_checkbox_; | 141 views::Checkbox* homepage_show_home_button_checkbox_; |
| 147 BooleanPrefMember new_tab_page_is_home_page_; | 142 BooleanPrefMember new_tab_page_is_home_page_; |
| 148 StringPrefMember homepage_; | 143 StringPrefMember homepage_; |
| 149 BooleanPrefMember show_home_button_; | 144 BooleanPrefMember show_home_button_; |
| 150 | 145 |
| 151 // Controls for the Search group | 146 // Controls for the Default Search group |
| 152 OptionsGroupView* default_search_group_; | 147 OptionsGroupView* default_search_group_; |
| 153 views::Combobox* default_search_engine_combobox_; | 148 views::Combobox* default_search_engine_combobox_; |
| 154 views::NativeButton* default_search_manage_engines_button_; | 149 views::NativeButton* default_search_manage_engines_button_; |
| 155 scoped_ptr<SearchEngineListModel> default_search_engines_model_; | 150 scoped_ptr<SearchEngineListModel> default_search_engines_model_; |
| 156 views::Checkbox* instant_checkbox_; | |
| 157 views::Link* instant_link_; | |
| 158 | 151 |
| 159 // Controls for the Default Browser group | 152 // Controls for the Default Browser group |
| 160 OptionsGroupView* default_browser_group_; | 153 OptionsGroupView* default_browser_group_; |
| 161 views::Label* default_browser_status_label_; | 154 views::Label* default_browser_status_label_; |
| 162 views::NativeButton* default_browser_use_as_default_button_; | 155 views::NativeButton* default_browser_use_as_default_button_; |
| 163 | 156 |
| 164 // The helper object that performs default browser set/check tasks. | 157 // The helper object that performs default browser set/check tasks. |
| 165 scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; | 158 scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; |
| 166 | 159 |
| 167 PrefChangeRegistrar registrar_; | 160 PrefChangeRegistrar registrar_; |
| 168 | 161 |
| 169 DISALLOW_COPY_AND_ASSIGN(GeneralPageView); | 162 DISALLOW_COPY_AND_ASSIGN(GeneralPageView); |
| 170 }; | 163 }; |
| 171 | 164 |
| 172 #endif // CHROME_BROWSER_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ | 165 #endif // CHROME_BROWSER_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ |
| OLD | NEW |