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

Unified Diff: chrome/browser/background/background_application_list_model.cc

Issue 383113002: Ephemeral apps should not trigger Chrome background mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | chrome/browser/background/background_application_list_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/background/background_application_list_model.cc
diff --git a/chrome/browser/background/background_application_list_model.cc b/chrome/browser/background/background_application_list_model.cc
index 712a2c147383460b50eb30b39036fcabc627b73c..305a99b1d2afc0b6821fb4f6759ac12d16ec35bc 100644
--- a/chrome/browser/background/background_application_list_model.cc
+++ b/chrome/browser/background/background_application_list_model.cc
@@ -25,6 +25,7 @@
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
+#include "extensions/browser/extension_util.h"
#include "extensions/browser/image_loader.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_icon_set.h"
@@ -314,6 +315,12 @@ bool BackgroundApplicationListModel::IsBackgroundApp(
!RequiresBackgroundModeForPushMessaging(extension))
return false;
+ // By design, ephemeral apps cannot have background activity. This point can
+ // be reached for platforms apps with the push messaging permission, so
Dmitry Titov 2014/07/14 03:26:35 Also this can be reached by apps with "background'
tmdiep 2014/07/14 04:25:36 Thanks for the suggestion. I've moved the check up
+ // disallow if the app is ephemeral.
+ if (extensions::util::IsEphemeralApp(extension.id(), profile))
+ return false;
+
// Extensions and packaged apps with background permission are always treated
// as background apps.
if (!extension.is_hosted_app())
« no previous file with comments | « no previous file | chrome/browser/background/background_application_list_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698