summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/options/exceptions_view.cc14
-rw-r--r--chrome/browser/views/options/exceptions_view.h2
2 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/views/options/exceptions_view.cc b/chrome/browser/views/options/exceptions_view.cc
index a49df3e..5e01b95 100644
--- a/chrome/browser/views/options/exceptions_view.cc
+++ b/chrome/browser/views/options/exceptions_view.cc
@@ -18,16 +18,24 @@
#include "views/window/window.h"
static const int kExceptionsViewInsetSize = 5;
+static ExceptionsView* instances[CONTENT_SETTINGS_NUM_TYPES] = { NULL };
// static
void ExceptionsView::ShowExceptionsWindow(gfx::NativeWindow parent,
HostContentSettingsMap* map,
- ContentSettingsType type) {
- views::Window::CreateChromeWindow(
- parent, gfx::Rect(), new ExceptionsView(map, type))->Show();
+ ContentSettingsType content_type) {
+ if (!instances[content_type]) {
+ instances[content_type] = new ExceptionsView(map, content_type);
+ views::Window::CreateChromeWindow(parent, gfx::Rect(),
+ instances[content_type]);
+ }
+
+ // This will show invisible windows and bring visible windows to the front.
+ instances[content_type]->window()->Show();
}
ExceptionsView::~ExceptionsView() {
+ instances[model_.content_type()] = NULL;
table_->SetModel(NULL);
}
diff --git a/chrome/browser/views/options/exceptions_view.h b/chrome/browser/views/options/exceptions_view.h
index cedda01..ca3b110 100644
--- a/chrome/browser/views/options/exceptions_view.h
+++ b/chrome/browser/views/options/exceptions_view.h
@@ -38,7 +38,7 @@ class ExceptionsView : public ExceptionEditorView::Delegate,
// Shows the Exceptions window.
static void ShowExceptionsWindow(gfx::NativeWindow parent,
HostContentSettingsMap* map,
- ContentSettingsType type);
+ ContentSettingsType content_type);
virtual ~ExceptionsView();