| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_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/ui/views/options/options_page_view.h" | 12 #include "chrome/browser/ui/views/options/options_page_view.h" |
| 13 #include "chrome/browser/ui/views/url_picker.h" | 13 #include "chrome/browser/ui/views/url_picker.h" |
| 14 #include "views/controls/button/button.h" |
| 14 #include "views/controls/combobox/combobox.h" | 15 #include "views/controls/combobox/combobox.h" |
| 15 #include "views/controls/button/button.h" | |
| 16 #include "views/controls/link.h" | 16 #include "views/controls/link.h" |
| 17 #include "views/controls/table/table_view_observer.h" | 17 #include "views/controls/table/table_view_observer.h" |
| 18 #include "views/controls/textfield/textfield_controller.h" |
| 18 #include "views/view.h" | 19 #include "views/view.h" |
| 19 | 20 |
| 20 class CustomHomePagesTableModel; | 21 class CustomHomePagesTableModel; |
| 21 class OptionsGroupView; | 22 class OptionsGroupView; |
| 22 class SearchEngineListModel; | 23 class SearchEngineListModel; |
| 23 | 24 |
| 24 namespace views { | 25 namespace views { |
| 25 class Checkbox; | 26 class Checkbox; |
| 26 class GroupboxView; | 27 class GroupboxView; |
| 27 class Label; | 28 class Label; |
| 28 class NativeButton; | 29 class NativeButton; |
| 29 class RadioButton; | 30 class RadioButton; |
| 30 class TableView; | 31 class TableView; |
| 31 class Textfield; | 32 class Textfield; |
| 32 } | 33 } |
| 33 | 34 |
| 34 /////////////////////////////////////////////////////////////////////////////// | 35 /////////////////////////////////////////////////////////////////////////////// |
| 35 // GeneralPageView | 36 // GeneralPageView |
| 36 | 37 |
| 37 class GeneralPageView : public OptionsPageView, | 38 class GeneralPageView : public OptionsPageView, |
| 38 public views::Combobox::Listener, | 39 public views::Combobox::Listener, |
| 39 public views::ButtonListener, | 40 public views::ButtonListener, |
| 40 public views::Textfield::Controller, | 41 public views::TextfieldController, |
| 41 public UrlPickerDelegate, | 42 public UrlPickerDelegate, |
| 42 public views::TableViewObserver, | 43 public views::TableViewObserver, |
| 43 public ShellIntegration::DefaultBrowserObserver, | 44 public ShellIntegration::DefaultBrowserObserver, |
| 44 public views::LinkController { | 45 public views::LinkController { |
| 45 public: | 46 public: |
| 46 explicit GeneralPageView(Profile* profile); | 47 explicit GeneralPageView(Profile* profile); |
| 47 virtual ~GeneralPageView(); | 48 virtual ~GeneralPageView(); |
| 48 | 49 |
| 49 protected: | 50 protected: |
| 50 // views::ButtonListener implementation: | 51 // views::ButtonListener: |
| 51 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 52 virtual void ButtonPressed(views::Button* sender, const views::Event& event); |
| 52 | 53 |
| 53 // views::Combobox::Listener implementation: | 54 // views::Combobox::Listener: |
| 54 virtual void ItemChanged(views::Combobox* combobox, | 55 virtual void ItemChanged(views::Combobox* combobox, |
| 55 int prev_index, | 56 int prev_index, |
| 56 int new_index); | 57 int new_index); |
| 57 | 58 |
| 58 // views::Textfield::Controller implementation: | 59 // views::TextfieldController: |
| 59 virtual void ContentsChanged(views::Textfield* sender, | 60 virtual void ContentsChanged(views::Textfield* sender, |
| 60 const std::wstring& new_contents); | 61 const std::wstring& new_contents); |
| 61 virtual bool HandleKeyEvent(views::Textfield* sender, | 62 virtual bool HandleKeyEvent(views::Textfield* sender, |
| 62 const views::KeyEvent& key_event); | 63 const views::KeyEvent& key_event); |
| 63 | 64 |
| 64 // OptionsPageView implementation: | 65 // OptionsPageView: |
| 65 virtual void InitControlLayout(); | 66 virtual void InitControlLayout(); |
| 66 virtual void NotifyPrefChanged(const std::string* pref_name); | 67 virtual void NotifyPrefChanged(const std::string* pref_name); |
| 67 virtual void HighlightGroup(OptionsGroup highlight_group); | 68 virtual void HighlightGroup(OptionsGroup highlight_group); |
| 68 | 69 |
| 69 // LinkController implementation: | 70 // views::LinkController: |
| 70 virtual void LinkActivated(views::Link* source, int event_flags); | 71 virtual void LinkActivated(views::Link* source, int event_flags); |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 // ShellIntegration::DefaultBrowserObserver implementation: | 74 // ShellIntegration::DefaultBrowserObserver implementation: |
| 74 // Updates the UI state to reflect the current default browser state. | 75 // Updates the UI state to reflect the current default browser state. |
| 75 virtual void SetDefaultBrowserUIState( | 76 virtual void SetDefaultBrowserUIState( |
| 76 ShellIntegration::DefaultBrowserUIState state); | 77 ShellIntegration::DefaultBrowserUIState state); |
| 77 | 78 |
| 78 // For Side by Side installs, this will disable the Default Browser setting | 79 // For Side by Side installs, this will disable the Default Browser setting |
| 79 // and display an explanitory message. | 80 // and display an explanitory message. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 165 |
| 165 // The helper object that performs default browser set/check tasks. | 166 // The helper object that performs default browser set/check tasks. |
| 166 scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; | 167 scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; |
| 167 | 168 |
| 168 PrefChangeRegistrar registrar_; | 169 PrefChangeRegistrar registrar_; |
| 169 | 170 |
| 170 DISALLOW_COPY_AND_ASSIGN(GeneralPageView); | 171 DISALLOW_COPY_AND_ASSIGN(GeneralPageView); |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 #endif // CHROME_BROWSER_UI_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ | 174 #endif // CHROME_BROWSER_UI_VIEWS_OPTIONS_GENERAL_PAGE_VIEW_H_ |
| OLD | NEW |