diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 17:21:51 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 17:21:51 +0000 |
commit | e72e8eb8fb4eb2daf5c4fd0e003e2eee04611ba6 (patch) | |
tree | 9b7258965b4e35bd5bc1cfafcc8ee7f26ce5c1e1 /chrome/browser/extensions/user_script_master.cc | |
parent | a5e2b71f09b590801b82c8a1ba48ee84893a4512 (diff) | |
download | chromium_src-e72e8eb8fb4eb2daf5c4fd0e003e2eee04611ba6.zip chromium_src-e72e8eb8fb4eb2daf5c4fd0e003e2eee04611ba6.tar.gz chromium_src-e72e8eb8fb4eb2daf5c4fd0e003e2eee04611ba6.tar.bz2 |
Abstract ExtensionPrefs into their own class.
Relands http://codereview.chromium.org/126281 which had been reverted due to a leak.
The only difference is in extension_prefs.h where extension_data_ is now a scoped_ptr.
Review URL: http://codereview.chromium.org/131040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18717 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/user_script_master.cc')
-rw-r--r-- | chrome/browser/extensions/user_script_master.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc index 5cf3696..0c1a4b0 100644 --- a/chrome/browser/extensions/user_script_master.cc +++ b/chrome/browser/extensions/user_script_master.cc @@ -259,10 +259,13 @@ UserScriptMaster::UserScriptMaster(MessageLoop* worker_loop, const FilePath& script_dir) : user_script_dir_(script_dir), worker_loop_(worker_loop), + extensions_service_ready_(false), pending_scan_(false) { if (!user_script_dir_.value().empty()) AddWatchedPath(script_dir); + registrar_.Add(this, NotificationType::EXTENSIONS_READY, + NotificationService::AllSources()); registrar_.Add(this, NotificationType::EXTENSIONS_LOADED, NotificationService::AllSources()); registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, @@ -327,6 +330,10 @@ void UserScriptMaster::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { switch (type.value) { + case NotificationType::EXTENSIONS_READY: + extensions_service_ready_ = true; + StartScan(); + break; case NotificationType::EXTENSIONS_LOADED: { // TODO(aa): Fix race here. A page could need a content script on startup, // before the extension has loaded. We need to freeze the renderer in @@ -344,7 +351,8 @@ void UserScriptMaster::Observe(NotificationType type, lone_scripts_.push_back(*iter); } } - StartScan(); + if (!extensions_service_ready_) + StartScan(); break; } |