| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/ui/website_settings_ui.h" | |
| 10 | |
| 11 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 12 | 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" | 13 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
| 14 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 14 | 15 |
| 15 class Browser; | 16 class Browser; |
| 16 class BubbleGtk; | |
| 17 class GtkThemeService; | 17 class GtkThemeService; |
| 18 class GURL; |
| 18 class Profile; | 19 class Profile; |
| 19 class TabContentsWrapper; | 20 class TabContentsWrapper; |
| 20 class WebsiteSettings; | 21 class WebsiteSettings; |
| 21 | 22 |
| 22 // GTK implementation of the website settings UI. The website settings UI is | 23 namespace content { |
| 23 // displayed in a popup that is positioned relative the an anchor element. | 24 struct SSLStatus; |
| 25 } |
| 26 |
| 27 // GTK implementation of the website settings UI. |
| 24 class WebsiteSettingsPopupGtk : public WebsiteSettingsUI, | 28 class WebsiteSettingsPopupGtk : public WebsiteSettingsUI, |
| 25 public BubbleDelegateGtk { | 29 public BubbleDelegateGtk { |
| 26 public: | 30 public: |
| 27 WebsiteSettingsPopupGtk(gfx::NativeWindow parent, | 31 // Creates a |WebsiteSettingsPopupGtk| and displays the UI. The |url| |
| 28 Profile* profile, | 32 // contains the omnibox URL of the currently active tab, |parent| contains |
| 29 TabContentsWrapper* wrapper); | 33 // the currently active window, |profile| contains the currently active |
| 30 virtual ~WebsiteSettingsPopupGtk(); | 34 // profile and |ssl| contains the |SSLStatus| of the connection to the |
| 35 // website in the currently active tab that is wrapped by the |
| 36 // |tab_contents_wrapper|. |
| 37 static void Show(gfx::NativeWindow parent, |
| 38 Profile* profile, |
| 39 TabContentsWrapper* tab_contents_wrapper, |
| 40 const GURL& url, |
| 41 const content::SSLStatus& ssl); |
| 31 | 42 |
| 32 // WebsiteSettingsUI implementations. | 43 // WebsiteSettingsUI implementations. |
| 33 virtual void SetPresenter(WebsiteSettings* presenter) OVERRIDE; | |
| 34 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) OVERRIDE; | 44 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) OVERRIDE; |
| 35 virtual void SetPermissionInfo( | 45 virtual void SetPermissionInfo( |
| 36 const PermissionInfoList& permission_info_list) OVERRIDE; | 46 const PermissionInfoList& permission_info_list) OVERRIDE; |
| 37 virtual void SetIdentityInfo(const IdentityInfo& identity_info) OVERRIDE; | 47 virtual void SetIdentityInfo(const IdentityInfo& identity_info) OVERRIDE; |
| 38 virtual void SetFirstVisit(const string16& first_visit) OVERRIDE; | 48 virtual void SetFirstVisit(const string16& first_visit) OVERRIDE; |
| 39 | 49 |
| 40 // BubbleDelegateGtk implementation. | 50 // BubbleDelegateGtk implementation. |
| 41 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; | 51 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; |
| 42 | 52 |
| 43 private: | 53 private: |
| 54 WebsiteSettingsPopupGtk(gfx::NativeWindow parent, |
| 55 Profile* profile, |
| 56 TabContentsWrapper* wrapper, |
| 57 const GURL& url, |
| 58 const content::SSLStatus& ssl); |
| 59 |
| 60 virtual ~WebsiteSettingsPopupGtk(); |
| 61 |
| 44 // Layouts the different sections retrieved from the model. | 62 // Layouts the different sections retrieved from the model. |
| 45 void InitContents(); | 63 void InitContents(); |
| 46 | 64 |
| 47 // Removes all children of |container|. | 65 // Removes all children of |container|. |
| 48 void ClearContainer(GtkWidget* container); | 66 void ClearContainer(GtkWidget* container); |
| 49 | 67 |
| 50 // Creates a label that contains the given |text| and has the given |width|. | 68 // Creates a label that contains the given |text| and has the given |width|. |
| 51 GtkWidget* CreateTextLabel(const std::string& text, int width); | 69 GtkWidget* CreateTextLabel(const std::string& text, int width); |
| 52 | 70 |
| 53 // Creates a popup section and returns a virtual box that contains the | 71 // Creates a popup section and returns a virtual box that contains the |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 GtkWidget* permissions_section_contents_; | 119 GtkWidget* permissions_section_contents_; |
| 102 | 120 |
| 103 // Container for the identity tab content. | 121 // Container for the identity tab content. |
| 104 GtkWidget* identity_tab_contents_; | 122 GtkWidget* identity_tab_contents_; |
| 105 | 123 |
| 106 // Container for the information about the first visit date of the website. | 124 // Container for the information about the first visit date of the website. |
| 107 GtkWidget* first_visit_contents_; | 125 GtkWidget* first_visit_contents_; |
| 108 | 126 |
| 109 // The UI translates user actions to specific events and forwards them to the | 127 // The UI translates user actions to specific events and forwards them to the |
| 110 // |presenter_|. The |presenter_| handles these events and updates the UI. | 128 // |presenter_|. The |presenter_| handles these events and updates the UI. |
| 111 WebsiteSettings* presenter_; | 129 scoped_ptr<WebsiteSettings> presenter_; |
| 112 | 130 |
| 113 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupGtk); | 131 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupGtk); |
| 114 }; | 132 }; |
| 115 | 133 |
| 116 #endif // CHROME_BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ | 134 #endif // CHROME_BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ |
| OLD | NEW |