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

Unified Diff: chrome/browser/extensions/user_script_listener.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_listener.cc
===================================================================
--- chrome/browser/extensions/user_script_listener.cc (revision 91968)
+++ chrome/browser/extensions/user_script_listener.cc (working copy)
@@ -6,6 +6,7 @@
#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/url_pattern.h"
#include "content/browser/browser_thread.h"
@@ -19,11 +20,11 @@
user_scripts_ready_(false) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- registrar_.Add(this, NotificationType::EXTENSION_LOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
NotificationService::AllSources());
- registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
NotificationService::AllSources());
- registrar_.Add(this, NotificationType::USER_SCRIPTS_UPDATED,
+ registrar_.Add(this, chrome::NOTIFICATION_USER_SCRIPTS_UPDATED,
NotificationService::AllSources());
AddRef(); // Will be balanced in Cleanup().
}
@@ -120,13 +121,13 @@
}
}
-void UserScriptListener::Observe(NotificationType type,
+void UserScriptListener::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- switch (type.value) {
- case NotificationType::EXTENSION_LOADED: {
+ switch (type) {
+ case chrome::NOTIFICATION_EXTENSION_LOADED: {
const Extension* extension = Details<const Extension>(details).ptr();
if (extension->content_scripts().empty())
return; // no new patterns from this extension.
@@ -143,7 +144,7 @@
break;
}
- case NotificationType::EXTENSION_UNLOADED: {
+ case chrome::NOTIFICATION_EXTENSION_UNLOADED: {
const Extension* unloaded_extension =
Details<UnloadedExtensionInfo>(details)->extension;
if (unloaded_extension->content_scripts().empty())
@@ -165,7 +166,7 @@
break;
}
- case NotificationType::USER_SCRIPTS_UPDATED: {
+ case chrome::NOTIFICATION_USER_SCRIPTS_UPDATED: {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
NewRunnableMethod(this, &UserScriptListener::StartDelayedRequests));
« no previous file with comments | « chrome/browser/extensions/user_script_listener.h ('k') | chrome/browser/extensions/user_script_listener_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698