OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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_WEBSITE_SETTINGS_POPUP_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "chrome/browser/ui/website_settings_ui.h" |
| 10 |
| 11 #include <gtk/gtk.h> |
| 12 |
| 13 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
| 14 |
| 15 class Browser; |
| 16 class BubbleGtk; |
| 17 class Profile; |
| 18 class TabContentsWrapper; |
| 19 class ThemeServiceGtk; |
| 20 |
| 21 // GTK implementation of the website settings UI. The website settings UI is |
| 22 // displayed in a popup that is positioned relative the an anchor element. |
| 23 class WebsiteSettingsPopupGtk : public WebsiteSettingsUI, |
| 24 public BubbleDelegateGtk { |
| 25 public: |
| 26 WebsiteSettingsPopupGtk(gfx::NativeWindow parent, |
| 27 Profile* profile, |
| 28 TabContentsWrapper* wrapper); |
| 29 virtual ~WebsiteSettingsPopupGtk(); |
| 30 |
| 31 // WebsiteSettingsUI implementations. |
| 32 virtual void SetDelegate(WebsiteSettingsUIDelegate* delegate) OVERRIDE; |
| 33 virtual void SetSiteInfo(const std::string site_info) OVERRIDE; |
| 34 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) OVERRIDE; |
| 35 virtual void SetPermissionInfo( |
| 36 const PermissionInfoList& permission_info_list) OVERRIDE; |
| 37 |
| 38 // BubbleDelegateGtk implementation. |
| 39 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; |
| 40 |
| 41 private: |
| 42 // Layouts the different sections retrieved from the model. |
| 43 void InitContents(); |
| 44 |
| 45 // Removes all children of |container|. |
| 46 void ClearContainer(GtkWidget* container); |
| 47 |
| 48 // Creates a popup section and returns a virtual box that contains the section |
| 49 // content. |
| 50 GtkWidget* CreateSection(std::string section_title, |
| 51 GtkWidget* section_content); |
| 52 |
| 53 // Callbacks for the link buttons. |
| 54 CHROMEGTK_CALLBACK_0(WebsiteSettingsPopupGtk, void, OnCookiesLinkClicked); |
| 55 CHROMEGTK_CALLBACK_0(WebsiteSettingsPopupGtk, void, OnPermissionChanged); |
| 56 CHROMEGTK_CALLBACK_0(WebsiteSettingsPopupGtk, void, |
| 57 OnPermissionsSettingsLinkClicked); |
| 58 CHROMEGTK_CALLBACK_1(WebsiteSettingsPopupGtk, void, OnComboBoxShown, |
| 59 GParamSpec*); |
| 60 |
| 61 // Parent window. |
| 62 GtkWindow* parent_; |
| 63 |
| 64 // The container that contains the content of the popup. |
| 65 GtkWidget* contents_; |
| 66 |
| 67 // The widget relative to which the popup is positioned. |
| 68 GtkWidget* anchor_; |
| 69 |
| 70 // Provides colors and stuff. |
| 71 ThemeServiceGtk* theme_service_; |
| 72 |
| 73 // The popup bubble container. |
| 74 BubbleGtk* bubble_; |
| 75 |
| 76 Profile* profile_; |
| 77 |
| 78 TabContentsWrapper* tab_contents_wrapper_; |
| 79 |
| 80 // The browser object of the current window. This is needed to open the |
| 81 // settings page in a new tab. |
| 82 Browser* browser_; |
| 83 |
| 84 // Container for the site info section content. |
| 85 GtkWidget* site_info_contents_; |
| 86 // Container for the cookies and site data section content. |
| 87 GtkWidget* cookies_section_contents_; |
| 88 // Container for the permissions section content. |
| 89 GtkWidget* permissions_section_contents_; |
| 90 |
| 91 WebsiteSettingsUIDelegate* delegate_; |
| 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupGtk); |
| 94 }; |
| 95 |
| 96 #endif // CHROME_BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ |
OLD | NEW |