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

Unified Diff: chrome/browser/views/blocked_popup_container.h

Issue 115149: Implement the popup blocking whitelist pref. This makes the whitelist actual... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/views/blocked_popup_container.h
===================================================================
--- chrome/browser/views/blocked_popup_container.h (revision 15670)
+++ chrome/browser/views/blocked_popup_container.h (working copy)
@@ -10,6 +10,7 @@
#ifndef CHROME_BROWSER_VIEWS_BLOCKED_POPUP_CONTAINER_H_
#define CHROME_BROWSER_VIEWS_BLOCKED_POPUP_CONTAINER_H_
+#include <set>
#include <utility>
#include <vector>
@@ -25,6 +26,7 @@
#include "views/widget/widget_win.h"
class BlockedPopupContainer;
+class PrefService;
class Profile;
class TabContents;
class TextButton;
@@ -91,13 +93,15 @@
public TabContentsDelegate,
public views::WidgetWin {
public:
- virtual ~BlockedPopupContainer();
+ static void RegisterUserPrefs(PrefService* prefs);
// Creates a BlockedPopupContainer, anchoring the container to the lower
// right corner.
static BlockedPopupContainer* Create(
TabContents* owner, Profile* profile, const gfx::Point& initial_anchor);
+ virtual ~BlockedPopupContainer();
+
// Adds a popup to this container. |bounds| are the window bounds requested by
// the popup window.
void AddTabContents(TabContents* tab_contents,
@@ -224,8 +228,11 @@
// string is hostname. bool is whitelisted status.
typedef std::map<std::string, bool> PopupHosts;
+ // string is hostname.
+ typedef std::set<std::string> Whitelist;
+
// Creates a container for a certain TabContents.
- BlockedPopupContainer(TabContents* owner, Profile* profile);
+ BlockedPopupContainer(TabContents* owner, PrefService* prefs);
// Overridden from Animation:
// Changes the visibility percentage of the BlockedPopupContainer. This is
@@ -279,9 +286,15 @@
// The TabContents that owns and constrains this BlockedPopupContainer.
TabContents* owner_;
+ // The PrefService we can query to find out what's on the whitelist.
+ PrefService* prefs_;
+
// Registrar to handle notifications we care about.
NotificationRegistrar registrar_;
+ // The whitelisted hosts, which we allow to open popups directly.
+ Whitelist whitelist_;
+
// Information about all blocked popups.
BlockedPopups blocked_popups_;

Powered by Google App Engine
This is Rietveld 408576698