Chromium Code Reviews| 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" |
|
tfarina
2012/06/04 20:06:13
nit: still missing the include to compiler_specifi
markusheintz_
2012/06/04 22:32:43
Done.
| |
| 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: |
| 31 // Creates a |WebsiteSettingsPopupGtk| and displays the UI. The |url| | |
| 32 // contains the omnibox URL of the currently active tab, |parent| contains | |
| 33 // the currently active window, |profile| contains the currently active | |
| 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); | |
| 42 | |
| 43 private: | |
| 27 WebsiteSettingsPopupGtk(gfx::NativeWindow parent, | 44 WebsiteSettingsPopupGtk(gfx::NativeWindow parent, |
| 28 Profile* profile, | 45 Profile* profile, |
| 29 TabContentsWrapper* wrapper); | 46 TabContentsWrapper* wrapper, |
| 30 virtual ~WebsiteSettingsPopupGtk(); | 47 const GURL& url, |
| 48 const content::SSLStatus& ssl); | |
| 31 | 49 |
| 32 // WebsiteSettingsUI implementations. | 50 // WebsiteSettingsUI implementations. |
| 33 virtual void SetPresenter(WebsiteSettings* presenter) OVERRIDE; | |
| 34 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) OVERRIDE; | 51 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) OVERRIDE; |
| 35 virtual void SetPermissionInfo( | 52 virtual void SetPermissionInfo( |
| 36 const PermissionInfoList& permission_info_list) OVERRIDE; | 53 const PermissionInfoList& permission_info_list) OVERRIDE; |
| 37 virtual void SetIdentityInfo(const IdentityInfo& identity_info) OVERRIDE; | 54 virtual void SetIdentityInfo(const IdentityInfo& identity_info) OVERRIDE; |
| 38 virtual void SetFirstVisit(const string16& first_visit) OVERRIDE; | 55 virtual void SetFirstVisit(const string16& first_visit) OVERRIDE; |
| 39 | 56 |
| 40 // BubbleDelegateGtk implementation. | 57 // BubbleDelegateGtk implementation. |
| 41 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; | 58 virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; |
| 42 | 59 |
| 43 private: | 60 |
| 61 virtual ~WebsiteSettingsPopupGtk(); | |
| 62 | |
| 44 // Layouts the different sections retrieved from the model. | 63 // Layouts the different sections retrieved from the model. |
| 45 void InitContents(); | 64 void InitContents(); |
| 46 | 65 |
| 47 // Removes all children of |container|. | 66 // Removes all children of |container|. |
| 48 void ClearContainer(GtkWidget* container); | 67 void ClearContainer(GtkWidget* container); |
| 49 | 68 |
| 50 // Creates a label that contains the given |text| and has the given |width|. | 69 // Creates a label that contains the given |text| and has the given |width|. |
| 51 GtkWidget* CreateTextLabel(const std::string& text, int width); | 70 GtkWidget* CreateTextLabel(const std::string& text, int width); |
| 52 | 71 |
| 53 // Creates a popup section and returns a virtual box that contains the | 72 // 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_; | 120 GtkWidget* permissions_section_contents_; |
| 102 | 121 |
| 103 // Container for the identity tab content. | 122 // Container for the identity tab content. |
| 104 GtkWidget* identity_tab_contents_; | 123 GtkWidget* identity_tab_contents_; |
| 105 | 124 |
| 106 // Container for the information about the first visit date of the website. | 125 // Container for the information about the first visit date of the website. |
| 107 GtkWidget* first_visit_contents_; | 126 GtkWidget* first_visit_contents_; |
| 108 | 127 |
| 109 // The UI translates user actions to specific events and forwards them to the | 128 // The UI translates user actions to specific events and forwards them to the |
| 110 // |presenter_|. The |presenter_| handles these events and updates the UI. | 129 // |presenter_|. The |presenter_| handles these events and updates the UI. |
| 111 WebsiteSettings* presenter_; | 130 scoped_ptr<WebsiteSettings> presenter_; |
| 112 | 131 |
| 113 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupGtk); | 132 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupGtk); |
| 114 }; | 133 }; |
| 115 | 134 |
| 116 #endif // CHROME_BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ | 135 #endif // CHROME_BROWSER_UI_GTK_WEBSITE_SETTINGS_POPUP_GTK_H_ |
| OLD | NEW |