Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 174277: override chrome:// URLs via extensions. (Closed)
Patch Set: fix linux errors Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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:
« no previous file with comments | « chrome/browser/extensions/extension_override_apitest.cc ('k') | chrome/browser/tab_contents/navigation_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698