| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 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 | 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_GTK_OPTIONS_GENERAL_PAGE_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_OPTIONS_GENERAL_PAGE_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_OPTIONS_GENERAL_PAGE_GTK_H_ | 6 #define CHROME_BROWSER_GTK_OPTIONS_GENERAL_PAGE_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "chrome/browser/cancelable_request.h" | 13 #include "chrome/browser/cancelable_request.h" |
| 14 #include "chrome/browser/options_page_base.h" | 14 #include "chrome/browser/options_page_base.h" |
| 15 #include "chrome/browser/search_engines/template_url_model.h" | 15 #include "chrome/browser/search_engines/template_url_model.h" |
| 16 #include "chrome/browser/shell_integration.h" |
| 16 #include "chrome/common/pref_member.h" | 17 #include "chrome/common/pref_member.h" |
| 17 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 18 | 19 |
| 19 class Profile; | 20 class Profile; |
| 20 class ListStoreFavIconLoader; | 21 class ListStoreFavIconLoader; |
| 21 | 22 |
| 22 class GeneralPageGtk : public OptionsPageBase, | 23 class GeneralPageGtk : public OptionsPageBase, |
| 23 public TemplateURLModelObserver { | 24 public TemplateURLModelObserver, |
| 25 public ShellIntegration::DefaultBrowserObserver { |
| 24 public: | 26 public: |
| 25 explicit GeneralPageGtk(Profile* profile); | 27 explicit GeneralPageGtk(Profile* profile); |
| 26 ~GeneralPageGtk(); | 28 ~GeneralPageGtk(); |
| 27 | 29 |
| 28 GtkWidget* get_page_widget() const { | 30 GtkWidget* get_page_widget() const { |
| 29 return page_; | 31 return page_; |
| 30 } | 32 } |
| 31 | 33 |
| 32 private: | 34 private: |
| 33 // Overridden from OptionsPageBase | 35 // Overridden from OptionsPageBase |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 GeneralPageGtk* general_page); | 121 GeneralPageGtk* general_page); |
| 120 | 122 |
| 121 // Callback for use as default browser button | 123 // Callback for use as default browser button |
| 122 static void OnBrowserUseAsDefaultClicked(GtkButton* button, | 124 static void OnBrowserUseAsDefaultClicked(GtkButton* button, |
| 123 GeneralPageGtk* general_page); | 125 GeneralPageGtk* general_page); |
| 124 | 126 |
| 125 // Enables/Disables the controls associated with the custom start pages | 127 // Enables/Disables the controls associated with the custom start pages |
| 126 // option if that preference is not selected. | 128 // option if that preference is not selected. |
| 127 void EnableCustomHomepagesControls(bool enable); | 129 void EnableCustomHomepagesControls(bool enable); |
| 128 | 130 |
| 129 // Sets the UI state to match | 131 // ShellIntegration::DefaultBrowserObserver implementation. |
| 130 void SetDefaultBrowserUIState(bool is_default); | 132 virtual void SetDefaultBrowserUIState( |
| 133 ShellIntegration::DefaultBrowserUIState state); |
| 131 | 134 |
| 132 // Widgets of the startup group | 135 // Widgets of the startup group |
| 133 GtkWidget* startup_homepage_radio_; | 136 GtkWidget* startup_homepage_radio_; |
| 134 GtkWidget* startup_last_session_radio_; | 137 GtkWidget* startup_last_session_radio_; |
| 135 GtkWidget* startup_custom_radio_; | 138 GtkWidget* startup_custom_radio_; |
| 136 GtkWidget* startup_custom_pages_tree_; | 139 GtkWidget* startup_custom_pages_tree_; |
| 137 GtkListStore* startup_custom_pages_model_; | 140 GtkListStore* startup_custom_pages_model_; |
| 138 GtkTreeSelection* startup_custom_pages_selection_; | 141 GtkTreeSelection* startup_custom_pages_selection_; |
| 139 GtkWidget* startup_add_custom_page_button_; | 142 GtkWidget* startup_add_custom_page_button_; |
| 140 GtkWidget* startup_remove_custom_page_button_; | 143 GtkWidget* startup_remove_custom_page_button_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 168 // Flag to ignore gtk callbacks while we are loading prefs, to avoid | 171 // Flag to ignore gtk callbacks while we are loading prefs, to avoid |
| 169 // then turning around and saving them again. | 172 // then turning around and saving them again. |
| 170 bool initializing_; | 173 bool initializing_; |
| 171 | 174 |
| 172 // Used in loading favicons. | 175 // Used in loading favicons. |
| 173 CancelableRequestConsumer fav_icon_consumer_; | 176 CancelableRequestConsumer fav_icon_consumer_; |
| 174 | 177 |
| 175 // Helper to load the favicon pixbufs into the |startup_custom_pages_model_|. | 178 // Helper to load the favicon pixbufs into the |startup_custom_pages_model_|. |
| 176 scoped_ptr<ListStoreFavIconLoader> favicon_loader_; | 179 scoped_ptr<ListStoreFavIconLoader> favicon_loader_; |
| 177 | 180 |
| 181 // The helper object that performs default browser set/check tasks. |
| 182 scoped_refptr<ShellIntegration::DefaultBrowserWorker> default_browser_worker_; |
| 183 |
| 178 DISALLOW_COPY_AND_ASSIGN(GeneralPageGtk); | 184 DISALLOW_COPY_AND_ASSIGN(GeneralPageGtk); |
| 179 }; | 185 }; |
| 180 | 186 |
| 181 #endif // CHROME_BROWSER_GTK_OPTIONS_GENERAL_PAGE_GTK_H_ | 187 #endif // CHROME_BROWSER_GTK_OPTIONS_GENERAL_PAGE_GTK_H_ |
| OLD | NEW |