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

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

Issue 125047: Finish extensions <-> task manager integration (Closed) Base URL: http://src.chromium.org/svn/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
Index: chrome/browser/extensions/extension_process_manager.cc
===================================================================
--- chrome/browser/extensions/extension_process_manager.cc (revision 18263)
+++ chrome/browser/extensions/extension_process_manager.cc (working copy)
@@ -11,6 +11,7 @@
#include "chrome/browser/tab_contents/site_instance.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/notification_service.h"
+#include "chrome/common/notification_type.h"
static void CreateBackgroundHosts(
ExtensionProcessManager* manager, const ExtensionList* extensions) {
@@ -48,6 +49,7 @@
ExtensionHost* host =
new ExtensionHost(extension, GetSiteInstanceForURL(url), url, this);
host->CreateView(browser);
+ OnExtensionHostCreated(host, false);
return host;
}
@@ -56,8 +58,7 @@
ExtensionHost* host =
new ExtensionHost(extension, GetSiteInstanceForURL(url), url, this);
host->CreateRenderView(NULL); // create a RenderViewHost with no view
- all_hosts_.insert(host);
- background_hosts_.insert(host);
+ OnExtensionHostCreated(host, true);
return host;
}
@@ -98,4 +99,19 @@
void ExtensionProcessManager::OnExtensionHostDestroyed(ExtensionHost* host) {
all_hosts_.erase(host);
background_hosts_.erase(host);
+ NotificationService::current()->Notify(
+ NotificationType::EXTENSION_HOST_DESTROYED,
+ Source<ExtensionProcessManager>(this),
+ Details<ExtensionHost>(host));
}
+
+void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host,
+ bool is_background) {
+ all_hosts_.insert(host);
+ if (is_background)
+ background_hosts_.insert(host);
+ NotificationService::current()->Notify(
+ NotificationType::EXTENSION_HOST_CREATED,
+ Source<ExtensionProcessManager>(this),
+ Details<ExtensionHost>(host));
+}
« no previous file with comments | « chrome/browser/extensions/extension_process_manager.h ('k') | chrome/browser/renderer_host/render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698