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

Unified Diff: chrome/browser/extensions/user_script_master.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/user_script_master.cc
===================================================================
--- chrome/browser/extensions/user_script_master.cc (revision 91968)
+++ chrome/browser/extensions/user_script_master.cc (working copy)
@@ -16,6 +16,7 @@
#include "base/version.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/extension_resource.h"
@@ -250,13 +251,13 @@
: extensions_service_ready_(false),
pending_load_(false),
profile_(profile) {
- registrar_.Add(this, NotificationType::EXTENSIONS_READY,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY,
Source<Profile>(profile_));
- registrar_.Add(this, NotificationType::EXTENSION_LOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
Source<Profile>(profile_));
- registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
Source<Profile>(profile_));
- registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED,
+ registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED,
NotificationService::AllSources());
}
@@ -286,22 +287,22 @@
}
NotificationService::current()->Notify(
- NotificationType::USER_SCRIPTS_UPDATED,
+ chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
Source<Profile>(profile_),
Details<base::SharedMemory>(handle));
}
}
-void UserScriptMaster::Observe(NotificationType type,
+void UserScriptMaster::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
bool should_start_load = false;
- switch (type.value) {
- case NotificationType::EXTENSIONS_READY:
+ switch (type) {
+ case chrome::NOTIFICATION_EXTENSIONS_READY:
extensions_service_ready_ = true;
should_start_load = true;
break;
- case NotificationType::EXTENSION_LOADED: {
+ case chrome::NOTIFICATION_EXTENSION_LOADED: {
// Add any content scripts inside the extension.
const Extension* extension = Details<const Extension>(details).ptr();
bool incognito_enabled = profile_->GetExtensionService()->
@@ -316,7 +317,7 @@
should_start_load = true;
break;
}
- case NotificationType::EXTENSION_UNLOADED: {
+ case chrome::NOTIFICATION_EXTENSION_UNLOADED: {
// Remove any content scripts.
const Extension* extension =
Details<UnloadedExtensionInfo>(details)->extension;
@@ -334,7 +335,7 @@
break;
}
- case NotificationType::RENDERER_PROCESS_CREATED: {
+ case content::NOTIFICATION_RENDERER_PROCESS_CREATED: {
RenderProcessHost* process = Source<RenderProcessHost>(source).ptr();
if (ScriptsReady())
SendUpdate(process, GetSharedMemory());
« no previous file with comments | « chrome/browser/extensions/user_script_master.h ('k') | chrome/browser/extensions/user_script_master_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698