summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-21 19:46:46 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-21 19:46:46 +0000
commitae09ca6b5ae2e930ef40fd291a08afd1289fafa1 (patch)
tree7dc3f5ca8440d45cfe905511d2cfd6c776dc4cc1 /chrome/browser/net
parentef6688c58eb5b2d238fd38bcf3513d4ebf7baa78 (diff)
downloadchromium_src-ae09ca6b5ae2e930ef40fd291a08afd1289fafa1.zip
chromium_src-ae09ca6b5ae2e930ef40fd291a08afd1289fafa1.tar.gz
chromium_src-ae09ca6b5ae2e930ef40fd291a08afd1289fafa1.tar.bz2
Load extensions that have their manifest in the Prefs on the UI thread.
There is some migration code for loading old extensions which we do on the UI thread as well, for simplicity. This will only happen the first time the user starts Chrome, so I think it's OK. Also cleaned up the EXTENSIONS_LOADED notification to send out a single extension, instead of a 1-element list of extensions. BUG=18293 TEST=loading extensions should still work Review URL: http://codereview.chromium.org/174208 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23997 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index a36887c..5bb921b 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -334,7 +334,7 @@ ChromeURLRequestContext::ChromeURLRequestContext(Profile* profile)
prefs_->AddPrefObserver(prefs::kDefaultCharset, this);
if (!is_off_the_record_) {
- registrar_.Add(this, NotificationType::EXTENSIONS_LOADED,
+ registrar_.Add(this, NotificationType::EXTENSION_LOADED,
NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
NotificationService::AllSources());
@@ -397,15 +397,12 @@ void ChromeURLRequestContext::Observe(NotificationType type,
&ChromeURLRequestContext::OnDefaultCharsetChange,
default_charset));
}
- } else if (NotificationType::EXTENSIONS_LOADED == type) {
+ } else if (NotificationType::EXTENSION_LOADED == type) {
ExtensionPaths* new_paths = new ExtensionPaths;
- ExtensionList* extensions = Details<ExtensionList>(details).ptr();
- DCHECK(extensions);
- for (ExtensionList::const_iterator iter = extensions->begin();
- iter != extensions->end(); ++iter) {
- new_paths->insert(ExtensionPaths::value_type((*iter)->id(),
- (*iter)->path()));
- }
+ Extension* extension = Details<Extension>(details).ptr();
+ DCHECK(extension);
+ new_paths->insert(ExtensionPaths::value_type(extension->id(),
+ extension->path()));
g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
NewRunnableMethod(this, &ChromeURLRequestContext::OnNewExtensions,
new_paths));