Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Unified Diff: chrome/browser/ui/gtk/website_settings_popup_gtk.cc

Issue 10440092: Remove any platform specific code from the chrome/browser/website_settings.* . (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..623e610e0857bb006eb90b5ce1b6dc656384cfda 100644
--- a/chrome/browser/ui/gtk/website_settings_popup_gtk.cc
+++ b/chrome/browser/ui/gtk/website_settings_popup_gtk.cc
@@ -20,14 +20,16 @@
#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 "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "grit/theme_resources.h"
#include "ui/base/gtk/gtk_hig_constants.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+#include "googleurl/src/gurl.h"
tfarina 2012/06/01 21:20:26 sort this.
markusheintz_ 2012/06/02 21:22:33 Done.
using content::OpenURLParams;
@@ -69,10 +71,25 @@ std::string PermissionValueToString(ContentSetting value) {
} // namespace
+// static
+void WebsiteSettingsPopupGtk::Show(gfx::NativeWindow parent,
tfarina 2012/06/01 21:20:26 the order of the implementation of this function i
markusheintz_ 2012/06/02 21:22:33 I'd prefere to have the same order as in the heade
+ Profile* profile,
+ TabContentsWrapper* tab_contents_wrapper,
+ const GURL& url,
+ const content::SSLStatus& ssl) {
+ new WebsiteSettingsPopupGtk(parent,
tfarina 2012/06/01 21:20:26 since this is your code and I'm not the OWNER, thi
markusheintz_ 2012/06/02 21:22:33 Cool. This fits in a single line. Great.
+ 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 +127,24 @@ WebsiteSettingsPopupGtk::WebsiteSettingsPopupGtk(
NOTREACHED();
return;
}
-}
-WebsiteSettingsPopupGtk::~WebsiteSettingsPopupGtk() {
+ presenter_.reset(new WebsiteSettings(
tfarina 2012/06/01 21:20:26 so you will have to do this in views and cocoa. :/
markusheintz_ 2012/06/02 21:22:33 I instantiated the WebsiteSettings class in the pl
+ 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);
tfarina 2012/06/01 21:20:26 you don't need to pass NULL here, scoped_ptr::rese
markusheintz_ 2012/06/02 21:22:33 Done.
+ delete this;
}
void WebsiteSettingsPopupGtk::InitContents() {
@@ -513,7 +535,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));
tfarina 2012/06/01 21:20:26 nit: while you are, fix the indentation here.
markusheintz_ 2012/06/02 21:22:33 Done. Same above.
}

Powered by Google App Engine
This is Rietveld 408576698