| 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 #ifndef CHROME_BROWSER_GTK_OPTIONS_CONTENT_SETTINGS_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_OPTIONS_CONTENT_SETTINGS_WINDOW_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_OPTIONS_CONTENT_SETTINGS_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_GTK_OPTIONS_CONTENT_SETTINGS_WINDOW_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include "chrome/browser/ui/gtk/options/content_settings_window_gtk.h" |
| 10 | 10 // TODO(msw): remove this file once all includes have been updated. |
| 11 #include "app/gtk_signal.h" | |
| 12 #include "base/scoped_ptr.h" | |
| 13 #include "chrome/browser/gtk/options/cookie_filter_page_gtk.h" | |
| 14 #include "chrome/browser/gtk/options/content_filter_page_gtk.h" | |
| 15 #include "chrome/browser/prefs/pref_member.h" | |
| 16 #include "chrome/common/content_settings_types.h" | |
| 17 | |
| 18 class AccessibleWidgetHelper; | |
| 19 | |
| 20 // A window that presents options to the user for blocking various kinds of | |
| 21 // content in webpages (cookies, javascript, images, popups). | |
| 22 class ContentSettingsWindowGtk { | |
| 23 public: | |
| 24 // Shows the current content settings page, opening a new one if it doesn't | |
| 25 // exist. | |
| 26 static void Show(GtkWindow* parent, ContentSettingsType page, | |
| 27 Profile* profile); | |
| 28 static void RegisterUserPrefs(PrefService* prefs); | |
| 29 | |
| 30 explicit ContentSettingsWindowGtk(GtkWindow* parent, Profile* profile); | |
| 31 virtual ~ContentSettingsWindowGtk(); | |
| 32 | |
| 33 private: | |
| 34 // Shows the Tab corresponding to the specified Content Settings page. | |
| 35 void ShowContentSettingsTab(ContentSettingsType page); | |
| 36 | |
| 37 CHROMEGTK_CALLBACK_2(ContentSettingsWindowGtk, void, OnSwitchPage, | |
| 38 GtkNotebookPage*, guint); | |
| 39 CHROMEGTK_CALLBACK_0(ContentSettingsWindowGtk, void, OnWindowDestroy); | |
| 40 CHROMEG_CALLBACK_0(ContentSettingsWindowGtk, void, OnListSelectionChanged, | |
| 41 GtkTreeSelection*); | |
| 42 | |
| 43 // The options dialog. | |
| 44 GtkWidget* dialog_; | |
| 45 | |
| 46 // The container of the option pages. | |
| 47 GtkWidget* notebook_; | |
| 48 GtkWidget* list_; | |
| 49 | |
| 50 // The Profile associated with these options. | |
| 51 Profile* profile_; | |
| 52 | |
| 53 // The last page the user was on when they opened the ContentSettings window. | |
| 54 IntegerPrefMember last_selected_page_; | |
| 55 | |
| 56 // The individual page implementations. Note that we have a specialized one | |
| 57 // for cookies (which have more complex rules) and use the same basic page | |
| 58 // layout for each other type. | |
| 59 CookieFilterPageGtk cookie_page_; | |
| 60 ContentFilterPageGtk image_page_; | |
| 61 ContentFilterPageGtk javascript_page_; | |
| 62 ContentFilterPageGtk plugin_page_; | |
| 63 ContentFilterPageGtk popup_page_; | |
| 64 ContentFilterPageGtk geolocation_page_; | |
| 65 ContentFilterPageGtk notifications_page_; | |
| 66 | |
| 67 // Helper object to manage accessibility metadata. | |
| 68 scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; | |
| 69 | |
| 70 DISALLOW_COPY_AND_ASSIGN(ContentSettingsWindowGtk); | |
| 71 }; | |
| 72 | 11 |
| 73 #endif // CHROME_BROWSER_GTK_OPTIONS_CONTENT_SETTINGS_WINDOW_GTK_H_ | 12 #endif // CHROME_BROWSER_GTK_OPTIONS_CONTENT_SETTINGS_WINDOW_GTK_H_ |
| OLD | NEW |