summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 23:39:14 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 23:39:14 +0000
commit10d879481a3c780cfe0bb71ba78566ee8080762d (patch)
tree355151a0ada75cee4e99634e0c2d19646cb3748c /chrome
parentc4cad5981822c86794df2eaf127ec20f2a34b35e (diff)
downloadchromium_src-10d879481a3c780cfe0bb71ba78566ee8080762d.zip
chromium_src-10d879481a3c780cfe0bb71ba78566ee8080762d.tar.gz
chromium_src-10d879481a3c780cfe0bb71ba78566ee8080762d.tar.bz2
Also reload extensions management page for extensions that
don't have a process. BUG=NONE TEST=Open two chrome windows, navigate one to extensions management UI. Install an extension that has no background process in the other. Management UI should show the installed extension automatically, without reload. Review URL: http://codereview.chromium.org/371043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31324 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extensions_ui.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index 55c05e0..c411444 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -297,14 +297,16 @@ void ExtensionsDOMHandler::OnIconsLoaded(DictionaryValue* json) {
// Register for notifications that we need to reload the page.
registrar_.RemoveAll();
+ registrar_.Add(this, NotificationType::EXTENSION_LOADED,
+ NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_PROCESS_CREATED,
NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
NotificationService::AllSources());
- registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED,
- NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_UNLOADED_DISABLED,
NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED,
+ NotificationService::AllSources());
}
ExtensionResource ExtensionsDOMHandler::PickExtensionIcon(
@@ -533,10 +535,19 @@ void ExtensionsDOMHandler::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
switch (type.value) {
+ // We listen to both EXTENSION_LOADED and EXTENSION_PROCESS_CREATED because
+ // we don't know about the views for an extension at EXTENSION_LOADED, but
+ // if we only listen to EXTENSION_PROCESS_CREATED, we'll miss extensions
+ // that don't have a process at startup.
+ //
+ // Doing it this way gets everything, but it means that we will actually
+ // render the page twice. This doesn't seem to result in any noticeable
+ // flicker, though.
+ case NotificationType::EXTENSION_LOADED:
case NotificationType::EXTENSION_PROCESS_CREATED:
case NotificationType::EXTENSION_UNLOADED:
- case NotificationType::EXTENSION_UPDATE_DISABLED:
case NotificationType::EXTENSION_UNLOADED_DISABLED:
+ case NotificationType::EXTENSION_UPDATE_DISABLED:
if (dom_ui_->tab_contents())
HandleRequestExtensionsData(NULL);
break;