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

Unified Diff: chrome/browser/views/options/exceptions_view.cc

Issue 593024: Merge 38516 - Prevent the user from triggering multiple copies of a particula... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 10 years, 10 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
« no previous file with comments | « chrome/browser/views/options/exceptions_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/options/exceptions_view.cc
===================================================================
--- chrome/browser/views/options/exceptions_view.cc (revision 38516)
+++ chrome/browser/views/options/exceptions_view.cc (working copy)
@@ -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);
}
« no previous file with comments | « chrome/browser/views/options/exceptions_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698