summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/user_script_master.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/user_script_master.h')
-rw-r--r--chrome/browser/extensions/user_script_master.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/chrome/browser/extensions/user_script_master.h b/chrome/browser/extensions/user_script_master.h
index 6a9a425..4367c7e 100644
--- a/chrome/browser/extensions/user_script_master.h
+++ b/chrome/browser/extensions/user_script_master.h
@@ -14,6 +14,7 @@
#include "base/scoped_ptr.h"
#include "base/shared_memory.h"
#include "chrome/common/extensions/user_script.h"
+#include "chrome/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
@@ -22,7 +23,8 @@ class StringPiece;
// Manages a segment of shared memory that contains the user scripts the user
// has installed. Lives on the UI thread.
class UserScriptMaster : public base::RefCounted<UserScriptMaster>,
- public DirectoryWatcher::Delegate {
+ public DirectoryWatcher::Delegate,
+ public NotificationObserver {
public:
// For testability, the constructor takes the MessageLoop to run the
// script-reloading worker on as well as the path the scripts live in.
@@ -30,11 +32,6 @@ class UserScriptMaster : public base::RefCounted<UserScriptMaster>,
UserScriptMaster(MessageLoop* worker, const FilePath& script_dir);
~UserScriptMaster();
- // Add a single user script that exists outside the script directory.
- void AddLoneScript(const UserScript& script) {
- lone_scripts_.push_back(script);
- }
-
// Add a watched directory. All scripts will be reloaded when any file in
// this directory changes.
void AddWatchedPath(const FilePath& path);
@@ -126,6 +123,14 @@ class UserScriptMaster : public base::RefCounted<UserScriptMaster>,
// DirectoryWatcher::Delegate implementation.
virtual void OnDirectoryChanged(const FilePath& path);
+ // NotificationObserver implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ // Manages our notification registrations.
+ NotificationRegistrar registrar_;
+
// The directories containing user scripts.
FilePath user_script_dir_;