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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 91968)
+++ chrome/browser/extensions/extension_process_manager.cc (working copy)
@@ -13,12 +13,12 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
#include "content/browser/site_instance.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_service.h"
-#include "content/common/notification_type.h"
namespace {
@@ -40,7 +40,7 @@
private:
// NotificationObserver:
- virtual void Observe(NotificationType type,
+ virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
@@ -87,19 +87,19 @@
ExtensionProcessManager::ExtensionProcessManager(Profile* profile)
: browsing_instance_(new BrowsingInstance(profile)) {
Profile* original_profile = profile->GetOriginalProfile();
- registrar_.Add(this, NotificationType::EXTENSIONS_READY,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
Source<Profile>(original_profile));
- registrar_.Add(this, NotificationType::EXTENSION_LOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
Source<Profile>(original_profile));
- registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
Source<Profile>(original_profile));
- registrar_.Add(this, NotificationType::EXTENSION_HOST_DESTROYED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
Source<Profile>(profile));
- registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED,
+ registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
NotificationService::AllSources());
- registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSED,
+ registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
NotificationService::AllSources());
- registrar_.Add(this, NotificationType::APP_TERMINATING,
+ registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING,
NotificationService::AllSources());
}
@@ -269,17 +269,17 @@
return all_hosts_.find(host) != all_hosts_.end();
}
-void ExtensionProcessManager::Observe(NotificationType type,
+void ExtensionProcessManager::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::EXTENSIONS_READY: {
+ switch (type) {
+ case chrome::NOTIFICATION_EXTENSIONS_READY: {
CreateBackgroundHosts(this,
Source<Profile>(source).ptr()->GetExtensionService()->extensions());
break;
}
- case NotificationType::EXTENSION_LOADED: {
+ case chrome::NOTIFICATION_EXTENSION_LOADED: {
ExtensionService* service =
Source<Profile>(source).ptr()->GetExtensionService();
if (service->is_ready()) {
@@ -289,7 +289,7 @@
break;
}
- case NotificationType::EXTENSION_UNLOADED: {
+ case chrome::NOTIFICATION_EXTENSION_UNLOADED: {
const Extension* extension =
Details<UnloadedExtensionInfo>(details)->extension;
for (ExtensionHostSet::iterator iter = background_hosts_.begin();
@@ -305,21 +305,21 @@
break;
}
- case NotificationType::EXTENSION_HOST_DESTROYED: {
+ case chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED: {
ExtensionHost* host = Details<ExtensionHost>(details).ptr();
all_hosts_.erase(host);
background_hosts_.erase(host);
break;
}
- case NotificationType::RENDERER_PROCESS_TERMINATED:
- case NotificationType::RENDERER_PROCESS_CLOSED: {
+ case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED:
+ case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: {
RenderProcessHost* host = Source<RenderProcessHost>(source).ptr();
UnregisterExtensionProcess(host->id());
break;
}
- case NotificationType::APP_TERMINATING: {
+ case content::NOTIFICATION_APP_TERMINATING: {
// Close background hosts when the last browser is closed so that they
// have time to shutdown various objects on different threads. Our
// destructor is called too late in the shutdown sequence.
@@ -340,7 +340,7 @@
if (is_background)
background_hosts_.insert(host);
NotificationService::current()->Notify(
- NotificationType::EXTENSION_HOST_CREATED,
+ chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
Source<ExtensionProcessManager>(this),
Details<ExtensionHost>(host));
}
@@ -365,7 +365,7 @@
GetExtensionProcessManager()) {
DCHECK(profile->IsOffTheRecord());
- registrar_.Add(this, NotificationType::BROWSER_WINDOW_READY,
+ registrar_.Add(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY,
NotificationService::AllSources());
}
@@ -439,11 +439,11 @@
}
void IncognitoExtensionProcessManager::Observe(
- NotificationType type,
+ int type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::BROWSER_WINDOW_READY: {
+ switch (type) {
+ case chrome::NOTIFICATION_BROWSER_WINDOW_READY: {
// We want to spawn our background hosts as soon as the user opens an
// incognito window. Watch for new browsers and create the hosts if
// it matches our profile.
« no previous file with comments | « chrome/browser/extensions/extension_process_manager.h ('k') | chrome/browser/extensions/extension_processes_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698