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

Unified Diff: chrome/browser/background_contents_service.cc

Issue 6297002: Preserve hosted apps' background contents across reload (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed the default case so that it shuts down BackgroundContents. Created 9 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/background_contents_service.cc
diff --git a/chrome/browser/background_contents_service.cc b/chrome/browser/background_contents_service.cc
index df6db030e7d882dd47126185a60f7a64774b60db..84fca87ad8156653c697e1ee3b74e9fc3bbbb0c4 100644
--- a/chrome/browser/background_contents_service.cc
+++ b/chrome/browser/background_contents_service.cc
@@ -113,10 +113,24 @@ void BackgroundContentsService::Observe(NotificationType type,
DCHECK(IsTracked(Details<BackgroundContents>(details).ptr()));
RegisterBackgroundContents(Details<BackgroundContents>(details).ptr());
break;
- case NotificationType::EXTENSION_UNLOADED:
- ShutdownAssociatedBackgroundContents(
- ASCIIToUTF16(
- Details<UnloadedExtensionInfo>(details)->extension->id()));
+ case NotificationType::EXTENSION_UNLOADED:
+ switch (Details<UnloadedExtensionInfo>(details)->reason) {
+ case UnloadedExtensionInfo::DISABLE: // Intentionally fall through.
+ case UnloadedExtensionInfo::UNINSTALL:
+ ShutdownAssociatedBackgroundContents(
+ ASCIIToUTF16(
+ Details<UnloadedExtensionInfo>(details)->extension->id()));
+ break;
+ case UnloadedExtensionInfo::UPDATE:
+ // Leave BackgroundContents in place
+ break;
+ default:
+ NOTREACHED();
+ ShutdownAssociatedBackgroundContents(
+ ASCIIToUTF16(
+ Details<UnloadedExtensionInfo>(details)->extension->id()));
+ break;
+ }
break;
default:
NOTREACHED();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698