diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 17:59:51 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 17:59:51 +0000 |
commit | 55f8faf008d870ec4cd8bba7c07a4c031b1ed8eb (patch) | |
tree | 632a51bc9fffbddb6d370c2887e64336abd3675f | |
parent | 0e00235b8b9ed764ab33892b395ad5dda3437977 (diff) | |
download | chromium_src-55f8faf008d870ec4cd8bba7c07a4c031b1ed8eb.zip chromium_src-55f8faf008d870ec4cd8bba7c07a4c031b1ed8eb.tar.gz chromium_src-55f8faf008d870ec4cd8bba7c07a4c031b1ed8eb.tar.bz2 |
Make extension sync change processor listen to events for disabled extensions.
BUG=46514
TEST=made sure syncing of an uninstalled disabled extension works
Review URL: http://codereview.chromium.org/2849027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50867 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/glue/extension_change_processor.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/chrome/browser/sync/glue/extension_change_processor.cc b/chrome/browser/sync/glue/extension_change_processor.cc index 31501e8..3e2d10d 100644 --- a/chrome/browser/sync/glue/extension_change_processor.cc +++ b/chrome/browser/sync/glue/extension_change_processor.cc @@ -48,7 +48,9 @@ void ExtensionChangeProcessor::Observe(NotificationType type, DCHECK(profile_); switch (type.value) { case NotificationType::EXTENSION_LOADED: - case NotificationType::EXTENSION_UNLOADED: { + case NotificationType::EXTENSION_UPDATE_DISABLED: + case NotificationType::EXTENSION_UNLOADED: + case NotificationType::EXTENSION_UNLOADED_DISABLED: { DCHECK_EQ(Source<Profile>(source).ptr(), profile_); Extension* extension = Details<Extension>(details).ptr(); CHECK(extension); @@ -144,16 +146,25 @@ void ExtensionChangeProcessor::StopImpl() { void ExtensionChangeProcessor::StartObserving() { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); DCHECK(profile_); - LOG(INFO) << "Observing EXTENSION_LOADED and EXTENSION_UNLOADED"; - // TODO(akalin): We miss notifications when we uninstall a disabled - // extension since EXTENSION_UNLOADED isn't sent in that case. Add - // an EXTENSION_UNINSTALLED notification and listen to it. + LOG(INFO) << "Observing EXTENSION_LOADED, EXTENSION_UPDATE_DISABLED, " + << "EXTENSION_UNLOADED, and EXTENSION_UNLOADED_DISABLED"; notification_registrar_.Add( this, NotificationType::EXTENSION_LOADED, Source<Profile>(profile_)); + // Despite the name, this notification is exactly like + // EXTENSION_LOADED but with an initial state of DISABLED. + // + // TODO(akalin): See if the themes change processor needs to listen + // to any of these, too. + notification_registrar_.Add( + this, NotificationType::EXTENSION_UPDATE_DISABLED, + Source<Profile>(profile_)); notification_registrar_.Add( this, NotificationType::EXTENSION_UNLOADED, Source<Profile>(profile_)); + notification_registrar_.Add( + this, NotificationType::EXTENSION_UNLOADED_DISABLED, + Source<Profile>(profile_)); } void ExtensionChangeProcessor::StopObserving() { |