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[] =
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);
// Fetch the function arguments.
scoped_ptr<glue::GetChannelId::Params> params(
glue::GetChannelId::Params::Create(*args_));
......
......@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Use <code>chrome.pushMessaging</code> to enable apps and extensions to
// receive message data sent through
// The <code>chrome.pushMessaging</code> API is deprecated since Chrome 38,
// 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>.
[deprecated="Use $(ref:gcm chrome.gcm) API"]
namespace pushMessaging {
dictionary Message {
......@@ -31,6 +33,7 @@ namespace pushMessaging {
// to trigger push messages back to the app or extension.
// If the interactive flag is set, we will ask the user to log in
// when they are not already logged in.
[deprecated="Use $(ref:gcm chrome.gcm) API"]
static void getChannelId(optional boolean interactive,
ChannelIdCallback callback);
};
......@@ -38,6 +41,7 @@ namespace pushMessaging {
interface Events {
// Fired when a push message has been received.
// |message| : The details associated with the message.
[deprecated="Use $(ref:gcm chrome.gcm) API"]
static void onMessage(Message message);
};
};
......@@ -2,8 +2,9 @@
<h1>Google Cloud Messaging for Chrome V1</h1>
<p class="note">
Google Cloud Messaging for Chrome V1 will be legacy soon.
Use the new <a href="cloudMessaging">Google Cloud Messaging API</a>.
Google Cloud Messaging for Chrome V1 is deprecated since Chrome 38.
It will be removed in Chrome 41.
Use the new <a href="cloudMessaging">Google Cloud Messaging</a>.
</p>
<p>
......@@ -116,14 +117,13 @@ to use the push messaging service
</ul>
</li>
<li>Set up your app or extension to use the service:
<ul>
<li>Add the permission to the manifest.</li>
<li>Include a call to <code>getChannelId</code>
for any user who is to receive a message.</li>
<li>Register a handler to receive the
<code>onMessage</code> event.</li>
</ul>
</li>
<ul>
<li>Add the permission to the manifest.</li>
<li>Include a call to <code>getChannelId</code>
for any user who is to receive a message.</li>
<li>Register a handler to receive the <code>onMessage</code> event.</li>
</ul>
</li>
<li>Publish your app in the Chrome Web Store. </li>
<li>Use refresh token to get a valid access token.</li>
<li>Send message to user.</li>
......
<meta name="doc-family" content="apps">
<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>
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.
The service handles all aspects of queueing and delivering messages.
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