Index: chrome/browser/extensions/extensions_service.cc |
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc |
index d389aa6675b9cf4f7b212c8252dd69bd96f5da1d..3243a28127142ca3aff64776b0b35fa9ff7170b1 100644 |
--- a/chrome/browser/extensions/extensions_service.cc |
+++ b/chrome/browser/extensions/extensions_service.cc |
@@ -11,6 +11,7 @@ |
#include "chrome/browser/chrome_thread.h" |
#include "chrome/browser/extensions/crx_installer.h" |
#include "chrome/browser/extensions/extension_browser_event_router.h" |
+#include "chrome/browser/extensions/extension_dom_ui.h" |
#include "chrome/browser/extensions/extension_file_util.h" |
#include "chrome/browser/extensions/extension_updater.h" |
#include "chrome/browser/extensions/external_extension_provider.h" |
@@ -193,6 +194,9 @@ void ExtensionsService::UninstallExtension(const std::string& extension_id, |
install_directory_)); |
} |
+ ExtensionDOMUI::UnregisterChromeURLOverrides(profile_, |
+ extension->GetChromeURLOverrides()); |
+ |
UnloadExtension(extension_id); |
} |
@@ -211,6 +215,9 @@ void ExtensionsService::EnableExtension(const std::string& extension_id) { |
extension); |
disabled_extensions_.erase(iter); |
+ ExtensionDOMUI::RegisterChromeURLOverrides(profile_, |
+ extension->GetChromeURLOverrides()); |
+ |
NotificationService::current()->Notify( |
NotificationType::EXTENSION_LOADED, |
Source<ExtensionsService>(this), |
@@ -312,6 +319,9 @@ void ExtensionsService::UnloadExtension(const std::string& extension_id) { |
// Callers should not send us nonexistant extensions. |
CHECK(extension.get()); |
+ ExtensionDOMUI::UnregisterChromeURLOverrides(profile_, |
+ extension->GetChromeURLOverrides()); |
+ |
ExtensionList::iterator iter = std::find(disabled_extensions_.begin(), |
disabled_extensions_.end(), |
extension.get()); |
@@ -422,6 +432,9 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension) { |
NotificationType::THEME_INSTALLED, |
Source<ExtensionsService>(this), |
Details<Extension>(extension)); |
+ } else { |
+ ExtensionDOMUI::RegisterChromeURLOverrides(profile_, |
+ extension->GetChromeURLOverrides()); |
} |
break; |
case Extension::DISABLED: |