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 <vector> |
| 12 |
| 13 #include <gtk/gtk.h> |
| 14 |
| 15 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
| 16 #include "chrome/browser/website_settings_model.h" |
| 17 #include "content/public/common/ssl_status.h" |
| 18 #include "googleurl/src/gurl.h" |
| 19 |
| 20 using content::SSLStatus; |
| 21 |
| 22 class BubbleGtk; |
| 23 class Profile; |
| 24 class TabContentsWrapper; |
| 25 class ThemeServiceGtk; |
| 26 |
| 27 // |
| 28 class WebsiteSettingsPopupGtk : public WebsiteSettingsUI, |
| 29 public BubbleDelegateGtk { |
| 30 public: |
| 31 WebsiteSettingsPopupGtk(gfx::NativeWindow parent, |
| 32 Profile* profile, |
| 33 TabContentsWrapper* wrapper, |
| 34 const GURL& url, |
| 35 const SSLStatus& ssl, |
| 36 bool show_history); |
| 37 virtual ~WebsiteSettingsPopupGtk(); |
| 38 |
| 39 // WebsiteSettingsUI implementations. |
| 40 virtual void SetSiteInfo(const std::string site_info) OVERRIDE; |
| 41 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) OVERRIDE; |
| 42 virtual void SetPermissionInfo( |
| 43 const PermissionInfoList& permission_info_list) OVERRIDE; |
| 44 |
| 45 // BubbleDelegateGtk implementation. |
| 46 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; |
| 47 |
| 48 private: |
| 49 // Layouts the different sections retrieved from the model. |
| 50 void InitContents(); |
| 51 |
| 52 // Removes all children of |container|. |
| 53 void ClearContainer(GtkWidget* container); |
| 54 |
| 55 // Creates a popup section. |
| 56 GtkWidget* CreateSection(std::string section_title, |
| 57 GtkWidget* section_content); |
| 58 |
| 59 // Link button callbacks. |
| 60 CHROMEGTK_CALLBACK_0(WebsiteSettingsPopupGtk, void, OnCookiesLinkClicked); |
| 61 CHROMEGTK_CALLBACK_0(WebsiteSettingsPopupGtk, void, |
| 62 OnCookieSettingsLinkClicked); |
| 63 CHROMEGTK_CALLBACK_0(WebsiteSettingsPopupGtk, void, OnPermissionChanged); |
| 64 CHROMEGTK_CALLBACK_0(WebsiteSettingsPopupGtk, void, |
| 65 OnPermissionsSettingsLinkClicked); |
| 66 |
| 67 scoped_ptr<WebsiteSettingsModel> website_settings_; |
| 68 |
| 69 // Parent window. |
| 70 GtkWindow* parent_; |
| 71 |
| 72 // The virtual box containing the sections. |
| 73 GtkWidget* contents_; |
| 74 |
| 75 // The widget relative to which we are positioned. |
| 76 GtkWidget* anchor_; |
| 77 |
| 78 // Provides colors and stuff. |
| 79 ThemeServiceGtk* theme_service_; |
| 80 |
| 81 BubbleGtk* bubble_; |
| 82 |
| 83 Profile* profile_; |
| 84 |
| 85 TabContentsWrapper* tab_contents_wrapper_; |
| 86 |
| 87 // UI elements |
| 88 GtkWidget* site_info_contents_; |
| 89 GtkWidget* cookies_section_content_; |
| 90 GtkWidget* permissions_section_content_; |
| 91 |
| 92 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupGtk); |
| 93 }; |
| 94 |
| 95 #endif // BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ |
OLD | NEW |