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

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

Issue 1018643003: Removing chrome.pushMessaging API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates to documentation per kalman's comments Created 5 years, 9 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
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 39f604dbae9a7f69358ea334a3f31ef800dae9a0..7488bb3ef3ee016cedba7d3d67bf51b8b49138f6 100644
--- a/chrome/browser/background/background_application_list_model.cc
+++ b/chrome/browser/background/background_application_list_model.cc
@@ -280,29 +280,6 @@ int BackgroundApplicationListModel::GetPosition(
}
// static
-bool BackgroundApplicationListModel::RequiresBackgroundModeForPushMessaging(
- const Extension& extension) {
- // No PushMessaging permission - does not require the background mode.
- if (!extension.permissions_data()->HasAPIPermission(
- APIPermission::kPushMessaging)) {
- return false;
- }
-
- // If in the whitelist, then does not require background mode even if
- // uses push messaging.
- // TODO(dimich): remove this whitelist once we have a better way to keep
- // listening for GCM. http://crbug.com/311268
- std::string hexencoded_id_hash =
- crx_file::id_util::HashedIdInHex(extension.id());
- // The id starting from "9A04..." is a one from unit test.
- if (hexencoded_id_hash == "C41AD9DCD670210295614257EF8C9945AD68D86E" ||
- hexencoded_id_hash == "9A0417016F345C934A1A88F55CA17C05014EEEBA")
- return false;
-
- return true;
-}
-
-// static
bool BackgroundApplicationListModel::IsBackgroundApp(
const Extension& extension, Profile* profile) {
// An extension is a "background app" if it has the "background API"
@@ -316,12 +293,11 @@ bool BackgroundApplicationListModel::IsBackgroundApp(
if (extensions::util::IsEphemeralApp(extension.id(), profile))
return false;
- // Not a background app if we don't have the background permission or
- // the push messaging permission
+ // Not a background app if we don't have the background permission.
if (!extension.permissions_data()->HasAPIPermission(
- APIPermission::kBackground) &&
- !RequiresBackgroundModeForPushMessaging(extension))
+ APIPermission::kBackground)) {
return false;
+ }
// Extensions and packaged apps with background permission are always treated
// as background apps.

Powered by Google App Engine
This is Rietveld 408576698