| 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..4b2fce01e92dc4fb43505891e86992cbd9a012fc 100644
|
| --- a/chrome/browser/ui/gtk/website_settings_popup_gtk.cc
|
| +++ b/chrome/browser/ui/gtk/website_settings_popup_gtk.cc
|
| @@ -22,6 +22,7 @@
|
| #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
|
| #include "chrome/browser/website_settings.h"
|
| #include "chrome/common/url_constants.h"
|
| +#include "content/public/browser/cert_store.h"
|
| #include "grit/generated_resources.h"
|
| #include "grit/locale_settings.h"
|
| #include "grit/theme_resources.h"
|
| @@ -69,10 +70,25 @@ 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 +126,24 @@ 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(NULL);
|
| + delete this;
|
| }
|
|
|
| void WebsiteSettingsPopupGtk::InitContents() {
|
| @@ -513,7 +534,7 @@ 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));
|
| }
|
|
|