Chromium Code Reviews| Index: chrome/browser/ui/gtk/website_settings_popup_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/website_settings_popup_gtk.cc b/chrome/browser/ui/gtk/website_settings_popup_gtk.cc |
| index e3eba5226c1cb5cf0298275f539e0e4e5a3c506e..0f299b0b7e8153e2f2238942b9ccaa8f7118fdcf 100644 |
| --- a/chrome/browser/ui/gtk/website_settings_popup_gtk.cc |
| +++ b/chrome/browser/ui/gtk/website_settings_popup_gtk.cc |
| @@ -4,7 +4,6 @@ |
| #include "chrome/browser/ui/gtk/website_settings_popup_gtk.h" |
| -#include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
|
tfarina
2012/06/03 16:12:19
nit: remove this, already included in header file.
markusheintz_
2012/06/04 16:33:54
Done.
|
| #include "base/i18n/rtl.h" |
| #include "base/string_number_conversions.h" |
| @@ -20,8 +19,10 @@ |
| #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
| #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| -#include "chrome/browser/website_settings.h" |
| +#include "chrome/browser/ui/website_settings/website_settings.h" |
| #include "chrome/common/url_constants.h" |
| +#include "content/public/browser/cert_store.h" |
| +#include "googleurl/src/gurl.h" |
| #include "grit/generated_resources.h" |
| #include "grit/locale_settings.h" |
| #include "grit/theme_resources.h" |
| @@ -69,10 +70,21 @@ std::string PermissionValueToString(ContentSetting value) { |
| } // namespace |
| +// static |
| +void WebsiteSettingsPopupGtk::Show(gfx::NativeWindow parent, |
| + Profile* profile, |
| + TabContentsWrapper* tab_contents_wrapper, |
| + const GURL& url, |
| + const content::SSLStatus& ssl) { |
| + new WebsiteSettingsPopupGtk(parent, profile, tab_contents_wrapper, url, ssl); |
| +} |
| + |
| WebsiteSettingsPopupGtk::WebsiteSettingsPopupGtk( |
| gfx::NativeWindow parent, |
| Profile* profile, |
| - TabContentsWrapper* tab_contents_wrapper) |
| + TabContentsWrapper* tab_contents_wrapper, |
| + const GURL& url, |
| + const content::SSLStatus& ssl) |
| : parent_(parent), |
| contents_(NULL), |
| theme_service_(GtkThemeService::GetFrom(profile)), |
| @@ -110,19 +122,21 @@ WebsiteSettingsPopupGtk::WebsiteSettingsPopupGtk( |
| NOTREACHED(); |
| return; |
| } |
| -} |
| -WebsiteSettingsPopupGtk::~WebsiteSettingsPopupGtk() { |
| + presenter_.reset(new WebsiteSettings(this, profile, |
| + tab_contents_wrapper->content_settings(), |
| + url, ssl, |
| + content::CertStore::GetInstance())); |
| } |
| -void WebsiteSettingsPopupGtk::SetPresenter(WebsiteSettings* presenter) { |
| - presenter_ = presenter; |
| +WebsiteSettingsPopupGtk::~WebsiteSettingsPopupGtk() { |
| } |
| void WebsiteSettingsPopupGtk::BubbleClosing(BubbleGtk* bubble, |
| bool closed_by_escape) { |
| - if (presenter_) |
| - presenter_->OnUIClosing(); |
| + if (presenter_.get()) |
| + presenter_.reset(); |
| + delete this; |
| } |
| void WebsiteSettingsPopupGtk::InitContents() { |
| @@ -494,7 +508,7 @@ void WebsiteSettingsPopupGtk::OnPermissionsSettingsLinkClicked( |
| GtkWidget* widget) { |
| browser_->OpenURL(OpenURLParams( |
| GURL(std::string( |
| - chrome::kChromeUISettingsURL) + chrome::kContentSettingsSubPage), |
| + chrome::kChromeUISettingsURL) + chrome::kContentSettingsSubPage), |
| content::Referrer(), |
| NEW_FOREGROUND_TAB, |
| content::PAGE_TRANSITION_LINK, |
| @@ -513,9 +527,9 @@ void WebsiteSettingsPopupGtk::OnPermissionChanged(GtkWidget* widget) { |
| int type = -1; |
| gtk_tree_model_get(store, &it, 1, &value, 2, &type, -1); |
| - if (presenter_) |
| + if (presenter_.get()) |
| presenter_->OnSitePermissionChanged(ContentSettingsType(type), |
| - ContentSetting(value)); |
| + ContentSetting(value)); |
| } |
| void WebsiteSettingsPopupGtk::OnViewCertLinkClicked(GtkWidget* widget) { |