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

Unified Diff: chrome/browser/extensions/extension_view.cc

Issue 125164: Fix a bug where ExtensionHost and ExtensionView weren't getting closed proper... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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/extensions/extension_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/extensions/extension_view.cc
===================================================================
--- chrome/browser/extensions/extension_view.cc (revision 18385)
+++ chrome/browser/extensions/extension_view.cc (working copy)
@@ -10,12 +10,16 @@
#if defined(OS_WIN)
#include "chrome/browser/renderer_host/render_widget_host_view_win.h"
#endif
+#include "chrome/common/notification_service.h"
+#include "chrome/common/notification_type.h"
#include "views/widget/widget.h"
ExtensionView::ExtensionView(ExtensionHost* host, Browser* browser)
: host_(host), browser_(browser),
initialized_(false), pending_preferred_width_(0), container_(NULL) {
host_->set_view(this);
+ registrar_.Add(this, NotificationType::BROWSER_CLOSED,
+ Source<Browser>(browser_));
}
ExtensionView::~ExtensionView() {
@@ -120,6 +124,16 @@
}
}
+void ExtensionView::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ if (type == NotificationType::BROWSER_CLOSED) {
+ delete host_; // which in turn deletes this
+ } else {
+ NOTREACHED();
+ }
+}
+
void ExtensionView::HandleMouseEvent() {
if (container_)
container_->OnExtensionMouseEvent(this);
« no previous file with comments | « chrome/browser/extensions/extension_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698