| OLD | NEW |
| 1 // Copyright (c) 2010 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 // The fonts page of the fonts & languages options dialog, which contains font | |
| 6 // family and size settings, as well as the default encoding option. | |
| 7 | |
| 8 #ifndef CHROME_BROWSER_GTK_OPTIONS_FONTS_PAGE_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_OPTIONS_FONTS_PAGE_GTK_H_ |
| 9 #define CHROME_BROWSER_GTK_OPTIONS_FONTS_PAGE_GTK_H_ | 6 #define CHROME_BROWSER_GTK_OPTIONS_FONTS_PAGE_GTK_H_ |
| 10 #pragma once | 7 #pragma once |
| 11 | 8 |
| 12 #include <gtk/gtk.h> | 9 #include "chrome/browser/ui/gtk/options/fonts_page_gtk.h" |
| 13 | 10 // TODO(msw): remove this file once all includes have been updated. |
| 14 #include "app/gtk_signal.h" | |
| 15 #include "base/scoped_ptr.h" | |
| 16 #include "chrome/browser/character_encoding.h" | |
| 17 #include "chrome/browser/prefs/pref_member.h" | |
| 18 #include "chrome/browser/ui/options/options_page_base.h" | |
| 19 | |
| 20 class DefaultEncodingComboboxModel; | |
| 21 | |
| 22 class FontsPageGtk : public OptionsPageBase { | |
| 23 public: | |
| 24 explicit FontsPageGtk(Profile* profile); | |
| 25 virtual ~FontsPageGtk(); | |
| 26 | |
| 27 GtkWidget* get_page_widget() const { return page_; } | |
| 28 | |
| 29 private: | |
| 30 void Init(); | |
| 31 void InitDefaultEncodingComboBox(); | |
| 32 | |
| 33 // Overridden from OptionsPageBase. | |
| 34 virtual void NotifyPrefChanged(const std::string* pref_name); | |
| 35 | |
| 36 // Retrieve the font selection from the button and save it to the prefs. Also | |
| 37 // ensure the button(s) are displayed in the proper size, as the | |
| 38 // GtkFontSelector returns the value in points not pixels. | |
| 39 void SetFontsFromButton(StringPrefMember* name_pref, | |
| 40 IntegerPrefMember* size_pref, | |
| 41 GtkWidget* font_button); | |
| 42 | |
| 43 CHROMEGTK_CALLBACK_0(FontsPageGtk, void, OnSerifFontSet); | |
| 44 CHROMEGTK_CALLBACK_0(FontsPageGtk, void, OnSansFontSet); | |
| 45 CHROMEGTK_CALLBACK_0(FontsPageGtk, void, OnFixedFontSet); | |
| 46 CHROMEGTK_CALLBACK_0(FontsPageGtk, void, OnDefaultEncodingChanged); | |
| 47 | |
| 48 // The font chooser widgets | |
| 49 GtkWidget* serif_font_button_; | |
| 50 GtkWidget* sans_font_button_; | |
| 51 GtkWidget* fixed_font_button_; | |
| 52 | |
| 53 // The default encoding combobox widget. | |
| 54 GtkWidget* default_encoding_combobox_; | |
| 55 scoped_ptr<DefaultEncodingComboboxModel> default_encoding_combobox_model_; | |
| 56 | |
| 57 // The widget containing the options for this page. | |
| 58 GtkWidget* page_; | |
| 59 | |
| 60 // Font name preferences. | |
| 61 StringPrefMember serif_name_; | |
| 62 StringPrefMember sans_serif_name_; | |
| 63 StringPrefMember fixed_width_name_; | |
| 64 | |
| 65 // Font size preferences, in pixels. | |
| 66 IntegerPrefMember variable_width_size_; | |
| 67 IntegerPrefMember fixed_width_size_; | |
| 68 | |
| 69 // Default encoding preference. | |
| 70 StringPrefMember default_encoding_; | |
| 71 | |
| 72 DISALLOW_COPY_AND_ASSIGN(FontsPageGtk); | |
| 73 }; | |
| 74 | 11 |
| 75 #endif // CHROME_BROWSER_GTK_OPTIONS_FONTS_PAGE_GTK_H_ | 12 #endif // CHROME_BROWSER_GTK_OPTIONS_FONTS_PAGE_GTK_H_ |
| OLD | NEW |