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

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

Issue 846023004: Removal of chrome.pushMessaging API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 50c426b7a0129c93b50c99efdfc459428956b71b..808d80a2df18be2582fc1bbf1c950553117c8825 100644
--- a/chrome/browser/background/background_application_list_model.cc
+++ b/chrome/browser/background/background_application_list_model.cc
@@ -280,30 +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 id_hash = base::SHA1HashString(extension.id());
- std::string hexencoded_id_hash = base::HexEncode(id_hash.c_str(),
- id_hash.length());
- // 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"
@@ -317,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.
« no previous file with comments | « chrome/browser/background/background_application_list_model.h ('k') | chrome/browser/extensions/api/push_messaging/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698