OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_GTK_OPTIONS_CONTENT_PAGE_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_OPTIONS_CONTENT_PAGE_GTK_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <gtk/gtk.h> |
| 10 |
| 11 #include <string> |
| 12 |
| 13 #include "app/gtk_signal.h" |
| 14 #include "chrome/browser/autofill/personal_data_manager.h" |
| 15 #include "chrome/browser/gtk/options/managed_prefs_banner_gtk.h" |
| 16 #include "chrome/browser/prefs/pref_member.h" |
| 17 #include "chrome/browser/sync/profile_sync_service.h" |
| 18 #include "chrome/browser/ui/options/options_page_base.h" |
| 19 |
| 20 class Profile; |
| 21 |
| 22 class ContentPageGtk : public OptionsPageBase, |
| 23 public ProfileSyncServiceObserver { |
| 24 public: |
| 25 explicit ContentPageGtk(Profile* profile); |
| 26 ~ContentPageGtk(); |
| 27 |
| 28 GtkWidget* get_page_widget() const { |
| 29 return page_; |
| 30 } |
| 31 |
| 32 // ProfileSyncServiceObserver method. |
| 33 virtual void OnStateChanged(); |
| 34 |
| 35 private: |
| 36 // Updates various sync controls based on the current sync state. |
| 37 void UpdateSyncControls(); |
| 38 |
| 39 // Overridden from OptionsPageBase. |
| 40 virtual void NotifyPrefChanged(const std::string* pref_name); |
| 41 |
| 42 // Overridden from OptionsPageBase. |
| 43 virtual void Observe(NotificationType type, |
| 44 const NotificationSource& source, |
| 45 const NotificationDetails& details); |
| 46 |
| 47 // Update content area after a theme changed. |
| 48 void ObserveThemeChanged(); |
| 49 |
| 50 // Initialize the option group widgets, return their container. |
| 51 GtkWidget* InitPasswordSavingGroup(); |
| 52 GtkWidget* InitFormAutoFillGroup(); |
| 53 GtkWidget* InitBrowsingDataGroup(); |
| 54 GtkWidget* InitThemesGroup(); |
| 55 GtkWidget* InitSyncGroup(); |
| 56 |
| 57 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnImportButtonClicked); |
| 58 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnGtkThemeButtonClicked); |
| 59 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnResetDefaultThemeButtonClicked); |
| 60 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnGetThemesButtonClicked); |
| 61 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnSystemTitleBarRadioToggled); |
| 62 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnShowPasswordsButtonClicked); |
| 63 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnPasswordRadioToggled); |
| 64 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnAutoFillButtonClicked); |
| 65 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnSyncStartStopButtonClicked); |
| 66 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnSyncCustomizeButtonClicked); |
| 67 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnSyncActionLinkClicked); |
| 68 CHROMEGTK_CALLBACK_1(ContentPageGtk, void, OnStopSyncDialogResponse, int); |
| 69 CHROMEGTK_CALLBACK_0(ContentPageGtk, void, OnPrivacyDashboardLinkClicked); |
| 70 |
| 71 // Widgets for the Password saving group. |
| 72 GtkWidget* passwords_asktosave_radio_; |
| 73 GtkWidget* passwords_neversave_radio_; |
| 74 GtkWidget* show_passwords_button_; |
| 75 |
| 76 // Widgets for the AutoFill group. |
| 77 GtkWidget* autofill_button_; |
| 78 |
| 79 // Widgets for the Appearance group. |
| 80 GtkWidget* system_title_bar_show_radio_; |
| 81 GtkWidget* system_title_bar_hide_radio_; |
| 82 GtkWidget* themes_reset_button_; |
| 83 #if defined(TOOLKIT_GTK) |
| 84 GtkWidget* gtk_theme_button_; |
| 85 #endif |
| 86 |
| 87 // Widgets for the Sync group. |
| 88 GtkWidget* sync_status_label_background_; |
| 89 GtkWidget* sync_status_label_; |
| 90 GtkWidget* sync_action_link_background_; |
| 91 GtkWidget* sync_action_link_; |
| 92 GtkWidget* sync_start_stop_button_; |
| 93 GtkWidget* sync_customize_button_; |
| 94 GtkWidget* privacy_dashboard_link_; |
| 95 |
| 96 // The parent GtkTable widget |
| 97 GtkWidget* page_; |
| 98 |
| 99 // Pref members. |
| 100 BooleanPrefMember ask_to_save_passwords_; |
| 101 BooleanPrefMember form_autofill_enabled_; |
| 102 BooleanPrefMember use_custom_chrome_frame_; |
| 103 |
| 104 // Flag to ignore gtk callbacks while we are loading prefs, to avoid |
| 105 // then turning around and saving them again. |
| 106 bool initializing_; |
| 107 |
| 108 NotificationRegistrar registrar_; |
| 109 |
| 110 // Cached pointer to ProfileSyncService, if it exists. Kept up to date |
| 111 // and NULL-ed out on destruction. |
| 112 ProfileSyncService* sync_service_; |
| 113 |
| 114 // Tracks managed preference warning banner state. |
| 115 ManagedPrefsBannerGtk managed_prefs_banner_; |
| 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(ContentPageGtk); |
| 118 }; |
| 119 |
| 120 #endif // CHROME_BROWSER_UI_GTK_OPTIONS_CONTENT_PAGE_GTK_H_ |
OLD | NEW |