summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/chrome_url_request_context.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 22:21:30 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 22:21:30 +0000
commit3540c591c0fc870a976edd6bbf5c01c530b67d90 (patch)
treecb91a5ad06959e36d488230f27a1f94e146f68b4 /chrome/browser/net/chrome_url_request_context.cc
parentb5b0687ff4386ba964ea6c7b5dd1f3e541b7708b (diff)
downloadchromium_src-3540c591c0fc870a976edd6bbf5c01c530b67d90.zip
chromium_src-3540c591c0fc870a976edd6bbf5c01c530b67d90.tar.gz
chromium_src-3540c591c0fc870a976edd6bbf5c01c530b67d90.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@16547 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/chrome_url_request_context.cc')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 3ea9cc1..ae75216 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -312,6 +312,9 @@ ChromeURLRequestContext::ChromeURLRequestContext(Profile* profile)
NotificationService::current()->AddObserver(
this, NotificationType::EXTENSIONS_LOADED,
NotificationService::AllSources());
+ NotificationService::current()->AddObserver(
+ this, NotificationType::EXTENSION_UNLOADED,
+ NotificationService::AllSources());
}
// NotificationObserver implementation.
@@ -349,6 +352,11 @@ void ChromeURLRequestContext::Observe(NotificationType type,
g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
NewRunnableMethod(this, &ChromeURLRequestContext::OnNewExtensions,
new_paths));
+ } else if (NotificationType::EXTENSION_UNLOADED == type) {
+ Extension* extension = Details<Extension>(details).ptr();
+ g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
+ NewRunnableMethod(this, &ChromeURLRequestContext::OnUnloadedExtension,
+ extension->id()));
} else {
NOTREACHED();
}
@@ -363,6 +371,9 @@ void ChromeURLRequestContext::CleanupOnUIThread() {
NotificationService::current()->RemoveObserver(
this, NotificationType::EXTENSIONS_LOADED,
NotificationService::AllSources());
+ NotificationService::current()->RemoveObserver(
+ this, NotificationType::EXTENSION_UNLOADED,
+ NotificationService::AllSources());
}
FilePath ChromeURLRequestContext::GetPathForExtension(const std::string& id) {
@@ -399,6 +410,13 @@ void ChromeURLRequestContext::OnNewExtensions(ExtensionPaths* new_paths) {
delete new_paths;
}
+void ChromeURLRequestContext::OnUnloadedExtension(
+ const std::string& extension_id) {
+ ExtensionPaths::iterator iter = extension_paths_.find(extension_id);
+ DCHECK(iter != extension_paths_.end());
+ extension_paths_.erase(iter);
+}
+
ChromeURLRequestContext::~ChromeURLRequestContext() {
DCHECK(NULL == prefs_);