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_; |