summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/user_script_master.h
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 22:39:57 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 22:39:57 +0000
commit894bb50fe9a1b145221dd6993c159ab9f7a0fc5d (patch)
treef201aa2984ce40b3ef3fd50f7d211280d1cd33c1 /chrome/browser/extensions/user_script_master.h
parent182ac532081125b65bc169b56eb8230063a8d3a6 (diff)
downloadchromium_src-894bb50fe9a1b145221dd6993c159ab9f7a0fc5d.zip
chromium_src-894bb50fe9a1b145221dd6993c159ab9f7a0fc5d.tar.gz
chromium_src-894bb50fe9a1b145221dd6993c159ab9f7a0fc5d.tar.bz2
Hook up more of extension uninstall.
Also removed all external dependencies from ExtensionsService. It now only sends out notifications, which other services consume. This should allow us to unit test the ExtensionsService frontend, but I haven't added that yet. Review URL: http://codereview.chromium.org/113493 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16676 0039d316-1c4b-4281-b951-d872f2087c98
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_;