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

Unified Diff: chrome/browser/extensions/api/push_messaging/push_messaging_api.cc

Issue 476883003: Add deprecation message in chrome.pushMessaging API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/extensions/api/push_messaging/push_messaging_api.cc
diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc
index c579e4473072de8ea4917edc04153f2cd443edcb..5c0a185f8099dbade98f6357d1696eeda0809fe7 100644
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc
@@ -48,7 +48,9 @@ const char kUserAccessTokenFailure[] =
const char kAPINotAvailableForUser[] =
"The API is not available for this user.";
const int kObfuscatedGaiaIdTimeoutInDays = 30;
-}
+const char kDeprecationMessage[] =
+ "The chrome.pushMessaging API is deprecated. Use chrome.gcm API instead.";
+} // namespace
namespace glue = api::push_messaging;
@@ -94,6 +96,9 @@ PushMessagingGetChannelIdFunction::PushMessagingGetChannelIdFunction()
PushMessagingGetChannelIdFunction::~PushMessagingGetChannelIdFunction() {}
bool PushMessagingGetChannelIdFunction::RunAsync() {
+ // Issue a deprecation message.
+ WriteToConsole(content::CONSOLE_MESSAGE_LEVEL_WARNING, kDeprecationMessage);
not at google - send to devlin 2014/08/14 22:16:08 How often do apps call this method? Because if it'
fgorski 2014/08/20 22:46:47 I am seeing it used very rarely (2 other APIs). ap
+
not at google - send to devlin 2014/08/14 22:16:08 Also: we should add an install warning for when th
Yoyo Zhou 2014/08/15 01:40:13 chrome_api_permissions? I'm not sure I follow "in
not at google - send to devlin 2014/08/15 15:54:17 I mean the same warning that shows up if you reque
Yoyo Zhou 2014/08/15 19:25:31 I dunno, I would just try calling extension->AddIn
fgorski 2014/08/20 22:46:46 We could add a check for deprecated permissions in
not at google - send to devlin 2014/08/21 00:36:33 I've wanted this actually, a feature file annotati
// Fetch the function arguments.
scoped_ptr<glue::GetChannelId::Params> params(
glue::GetChannelId::Params::Create(*args_));
« no previous file with comments | « no previous file | chrome/common/extensions/api/push_messaging.idl » ('j') | chrome/common/extensions/api/push_messaging.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698