summaryrefslogtreecommitdiffstats
path: root/chrome/browser/background_mode_manager.cc
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-03 00:11:26 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-03 00:11:26 +0000
commite2e8bf54d9ad4192252e0776eb76931e24ecc331 (patch)
treeb0a4d7c47338f959b3da62c236efca7300252f48 /chrome/browser/background_mode_manager.cc
parent05acb55477b46dea9faf43e874f2bbb9f0640cb8 (diff)
downloadchromium_src-e2e8bf54d9ad4192252e0776eb76931e24ecc331.zip
chromium_src-e2e8bf54d9ad4192252e0776eb76931e24ecc331.tar.gz
chromium_src-e2e8bf54d9ad4192252e0776eb76931e24ecc331.tar.bz2
BackgroundModeManager now ignores unloads of disabled extensions.
Make sure we don't incorrectly double-decrement the background app count when the user uninstalls a disabled extension. BUG=71626 TEST=Install background extension, disable it, uninstall it, make sure no crash happens. Review URL: http://codereview.chromium.org/6292018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/background_mode_manager.cc')
-rw-r--r--chrome/browser/background_mode_manager.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc
index b6c6a4d..5ef5c64 100644
--- a/chrome/browser/background_mode_manager.cc
+++ b/chrome/browser/background_mode_manager.cc
@@ -132,6 +132,14 @@ void BackgroundModeManager::Observe(NotificationType type,
case NotificationType::EXTENSION_UNLOADED:
if (BackgroundApplicationListModel::IsBackgroundApp(
*Details<UnloadedExtensionInfo>(details)->extension)) {
+ Details<UnloadedExtensionInfo> info =
+ Details<UnloadedExtensionInfo>(details);
+ // If we already got an unload notification when it was disabled, ignore
+ // this one.
+ // TODO(atwilson): Change BackgroundModeManager to use
+ // BackgroundApplicationListModel instead of tracking the count here.
+ if (info->already_disabled)
+ return;
OnBackgroundAppUnloaded();
OnBackgroundAppUninstalled();
}