Commit 0dcab3d5 authored by fgorski's avatar fgorski Committed by Commit bot

Add deprecation message in chrome.pushMessaging API

Deprecation messages are added in:
* getChannelId function - displayed to console
* documentation of chrome.pushMessaging/GCM for Chrome V1

BUG=403952

Review URL: https://codereview.chromium.org/476883003

Cr-Commit-Position: refs/heads/master@{#293539}
parent 120ebf5b
...@@ -48,7 +48,9 @@ const char kUserAccessTokenFailure[] = ...@@ -48,7 +48,9 @@ const char kUserAccessTokenFailure[] =
const char kAPINotAvailableForUser[] = const char kAPINotAvailableForUser[] =
"The API is not available for this user."; "The API is not available for this user.";
const int kObfuscatedGaiaIdTimeoutInDays = 30; const int kObfuscatedGaiaIdTimeoutInDays = 30;
} const char kDeprecationMessage[] =
"The chrome.pushMessaging API is deprecated. Use chrome.gcm API instead.";
} // namespace
namespace glue = api::push_messaging; namespace glue = api::push_messaging;
...@@ -94,6 +96,9 @@ PushMessagingGetChannelIdFunction::PushMessagingGetChannelIdFunction() ...@@ -94,6 +96,9 @@ PushMessagingGetChannelIdFunction::PushMessagingGetChannelIdFunction()
PushMessagingGetChannelIdFunction::~PushMessagingGetChannelIdFunction() {} PushMessagingGetChannelIdFunction::~PushMessagingGetChannelIdFunction() {}
bool PushMessagingGetChannelIdFunction::RunAsync() { bool PushMessagingGetChannelIdFunction::RunAsync() {
// Issue a deprecation message.
WriteToConsole(content::CONSOLE_MESSAGE_LEVEL_WARNING, kDeprecationMessage);
// Fetch the function arguments. // Fetch the function arguments.
scoped_ptr<glue::GetChannelId::Params> params( scoped_ptr<glue::GetChannelId::Params> params(
glue::GetChannelId::Params::Create(*args_)); glue::GetChannelId::Params::Create(*args_));
......
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Use <code>chrome.pushMessaging</code> to enable apps and extensions to // The <code>chrome.pushMessaging</code> API is deprecated since Chrome 38,
// receive message data sent through // and will no longer be supported in Chrome 41.
// Switch to <code>$(ref:gcm chrome.gcm)</code> to take advantage of
// <a href="cloudMessaging.html">Google Cloud Messaging</a>. // <a href="cloudMessaging.html">Google Cloud Messaging</a>.
[deprecated="Use $(ref:gcm chrome.gcm) API"]
namespace pushMessaging { namespace pushMessaging {
dictionary Message { dictionary Message {
...@@ -31,6 +33,7 @@ namespace pushMessaging { ...@@ -31,6 +33,7 @@ namespace pushMessaging {
// to trigger push messages back to the app or extension. // to trigger push messages back to the app or extension.
// If the interactive flag is set, we will ask the user to log in // If the interactive flag is set, we will ask the user to log in
// when they are not already logged in. // when they are not already logged in.
[deprecated="Use $(ref:gcm chrome.gcm) API"]
static void getChannelId(optional boolean interactive, static void getChannelId(optional boolean interactive,
ChannelIdCallback callback); ChannelIdCallback callback);
}; };
...@@ -38,6 +41,7 @@ namespace pushMessaging { ...@@ -38,6 +41,7 @@ namespace pushMessaging {
interface Events { interface Events {
// Fired when a push message has been received. // Fired when a push message has been received.
// |message| : The details associated with the message. // |message| : The details associated with the message.
[deprecated="Use $(ref:gcm chrome.gcm) API"]
static void onMessage(Message message); static void onMessage(Message message);
}; };
}; };
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
<h1>Google Cloud Messaging for Chrome V1</h1> <h1>Google Cloud Messaging for Chrome V1</h1>
<p class="note"> <p class="note">
Google Cloud Messaging for Chrome V1 will be legacy soon. Google Cloud Messaging for Chrome V1 is deprecated since Chrome 38.
Use the new <a href="cloudMessaging">Google Cloud Messaging API</a>. It will be removed in Chrome 41.
Use the new <a href="cloudMessaging">Google Cloud Messaging</a>.
</p> </p>
<p> <p>
...@@ -120,8 +121,7 @@ to use the push messaging service ...@@ -120,8 +121,7 @@ to use the push messaging service
<li>Add the permission to the manifest.</li> <li>Add the permission to the manifest.</li>
<li>Include a call to <code>getChannelId</code> <li>Include a call to <code>getChannelId</code>
for any user who is to receive a message.</li> for any user who is to receive a message.</li>
<li>Register a handler to receive the <li>Register a handler to receive the <code>onMessage</code> event.</li>
<code>onMessage</code> event.</li>
</ul> </ul>
</li> </li>
<li>Publish your app in the Chrome Web Store. </li> <li>Publish your app in the Chrome Web Store. </li>
......
<meta name="doc-family" content="apps"> <meta name="doc-family" content="apps">
<h1>API Reference for GCM service</h1> <h1>API Reference for GCM service</h1>
<p class="note">
This document explains sending messages to chrome.pushMessaging API, which is
deprecated since Chrome 38. The API will be removed in Chrome 41.
Use the new <a href="cloudMessaging">Google Cloud Messaging</a>.
</p>
<p> <p>
The <a href="cloudMessaging">Google Cloud Messaging for Chrome</a> service The <a href="cloudMessagingV1">Google Cloud Messaging for Chrome</a> service
sends messages to users of a Chrome App. sends messages to users of a Chrome App.
The service handles all aspects of queueing and delivering messages. The service handles all aspects of queueing and delivering messages.
To use the service, To use the service,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment