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