OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_GTK_OPTIONS_GENERAL_PAGE_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_OPTIONS_GENERAL_PAGE_GTK_H_ |
| 7 |
| 8 #include <gtk/gtk.h> |
| 9 |
| 10 #include "chrome/browser/options_page_base.h" |
| 11 #include "chrome/browser/profile.h" |
| 12 #include "chrome/common/pref_member.h" |
| 13 #include "googleurl/src/gurl.h" |
| 14 |
| 15 class GeneralPageGtk : public OptionsPageBase { |
| 16 public: |
| 17 explicit GeneralPageGtk(Profile* profile); |
| 18 ~GeneralPageGtk(); |
| 19 |
| 20 GtkWidget* get_page_widget() const { |
| 21 return page_; |
| 22 } |
| 23 |
| 24 private: |
| 25 // Overridden from OptionsPageBase |
| 26 virtual void NotifyPrefChanged(const std::wstring* pref_name); |
| 27 virtual void HighlightGroup(OptionsGroup highlight_group); |
| 28 |
| 29 // Initialize the option group widgets, return their container |
| 30 GtkWidget* InitStartupGroup(); |
| 31 GtkWidget* InitHomepageGroup(); |
| 32 GtkWidget* InitDefaultSearchGroup(); |
| 33 GtkWidget* InitDefaultBrowserGroup(); |
| 34 |
| 35 // Saves the startup preference from the values in the ui |
| 36 void SaveStartupPref(); |
| 37 |
| 38 // Sets the home page preferences for kNewTabPageIsHomePage and kHomePage. |
| 39 // If a blank string is passed in we revert to using NewTab page as the Home |
| 40 // page. When setting the Home Page to NewTab page, we preserve the old value |
| 41 // of kHomePage (we don't overwrite it). |
| 42 void SetHomepage(const GURL& homepage); |
| 43 |
| 44 // Sets the home page pref using the value in the entry box |
| 45 void SetHomepageFromEntry(); |
| 46 |
| 47 // Callback for startup radio buttons |
| 48 static void OnStartupRadioToggled(GtkToggleButton* toggle_button, |
| 49 GeneralPageGtk* general_page); |
| 50 |
| 51 // Callback for new tab behavior radio buttons |
| 52 static void OnNewTabIsHomePageToggled(GtkToggleButton* toggle_button, |
| 53 GeneralPageGtk* general_page); |
| 54 |
| 55 // Callback for homepage URL entry |
| 56 static void OnHomepageUseUrlEntryChanged(GtkEditable* editable, |
| 57 GeneralPageGtk* general_page); |
| 58 |
| 59 // Callback for Show Home Button option |
| 60 static void OnShowHomeButtonToggled(GtkToggleButton* toggle_button, |
| 61 GeneralPageGtk* general_page); |
| 62 |
| 63 // Callback for use as default browser button |
| 64 static void OnBrowserUseAsDefaultClicked(GtkButton* button, |
| 65 GeneralPageGtk* general_page); |
| 66 |
| 67 // Enables/Disables the controls associated with the custom start pages |
| 68 // option if that preference is not selected. |
| 69 void EnableCustomHomepagesControls(bool enable); |
| 70 |
| 71 // Sets the UI state to match |
| 72 void SetDefaultBrowserUIState(bool is_default); |
| 73 |
| 74 // Widgets of the startup group |
| 75 GtkWidget* startup_homepage_radio_; |
| 76 GtkWidget* startup_last_session_radio_; |
| 77 GtkWidget* startup_custom_radio_; |
| 78 GtkWidget* startup_custom_pages_tree_; |
| 79 GtkWidget* startup_add_custom_page_button_; |
| 80 GtkWidget* startup_remove_custom_page_button_; |
| 81 GtkWidget* startup_use_current_page_button_; |
| 82 |
| 83 // Widgets and prefs of the homepage group |
| 84 GtkWidget* homepage_use_newtab_radio_; |
| 85 GtkWidget* homepage_use_url_radio_; |
| 86 GtkWidget* homepage_use_url_entry_; |
| 87 GtkWidget* homepage_show_home_button_checkbox_; |
| 88 BooleanPrefMember new_tab_page_is_home_page_; |
| 89 StringPrefMember homepage_; |
| 90 BooleanPrefMember show_home_button_; |
| 91 |
| 92 // Widgets of the default search group |
| 93 GtkWidget* default_search_engine_combobox_; |
| 94 GtkWidget* default_search_manage_engines_button_; |
| 95 |
| 96 // Widgets of the default browser group |
| 97 GtkWidget* default_browser_status_label_; |
| 98 GtkWidget* default_browser_use_as_default_button_; |
| 99 |
| 100 // The parent GtkTable widget |
| 101 GtkWidget* page_; |
| 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(GeneralPageGtk); |
| 104 }; |
| 105 |
| 106 #endif // CHROME_BROWSER_GTK_OPTIONS_GENERAL_PAGE_GTK_H_ |
OLD | NEW |