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

Unified Diff: content/renderer/push_messaging/push_messaging_dispatcher.cc

Issue 1145163002: Include a deprecation warning when people only use "gcm_user_visible_only". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/push_messaging/push_messaging_dispatcher.cc
diff --git a/content/renderer/push_messaging/push_messaging_dispatcher.cc b/content/renderer/push_messaging/push_messaging_dispatcher.cc
index e3f838a1af4d3d55f6a211b989542cd4b5a2f677..87d542898db980ed76fd413d0d1476d8d504b64a 100644
--- a/content/renderer/push_messaging/push_messaging_dispatcher.cc
+++ b/content/renderer/push_messaging/push_messaging_dispatcher.cc
@@ -15,12 +15,19 @@
#include "third_party/WebKit/public/platform/modules/push_messaging/WebPushError.h"
#include "third_party/WebKit/public/platform/modules/push_messaging/WebPushSubscription.h"
#include "third_party/WebKit/public/platform/modules/push_messaging/WebPushSubscriptionOptions.h"
+#include "third_party/WebKit/public/web/WebConsoleMessage.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "url/gurl.h"
using blink::WebString;
namespace content {
+const char kManifestDeprecationWarning[] =
johnme 2015/05/20 14:05:41 Move to anonymous namespace?
Peter Beverloo 2015/05/20 14:15:13 No, constants are internally linked by default so
+ "The 'gcm_user_visible_only' manifest key is deprecated and will be "
+ "removed in Chrome 45, around August 2015. Use PushSubscriptionOptions "
johnme 2015/05/20 14:05:41 Nit: How about "Call pushManager.subscribe({userVi
Peter Beverloo 2015/05/20 14:15:14 Changed..
+ "when subscribing for push instead.";
+
PushMessagingDispatcher::PushMessagingDispatcher(RenderFrame* render_frame)
: RenderFrameObserver(render_frame) {
}
@@ -74,8 +81,17 @@ void PushMessagingDispatcher::DoSubscribe(
return;
}
- // TODO(peter): Display a deprecation warning if gcm_user_visible_only is
- // set to true. See https://crbug.com/471534
+ // Support for the "gcm_user_visible_only" Manifest key has been deprecated
+ // in favor of the userVisibleOnly subscription option, and will be removed
+ // in a future Chrome release. Inform developers of this deprecation.
+ if (manifest.gcm_user_visible_only && !options.userVisibleOnly) {
+ blink::WebConsoleMessage message(
+ blink::WebConsoleMessage::LevelWarning,
+ blink::WebString::fromUTF8(kManifestDeprecationWarning));
+
+ render_frame()->GetWebFrame()->addMessageToConsole(message);
johnme 2015/05/20 14:05:41 Ideally we'd log no more than once per page load;
Peter Beverloo 2015/05/20 14:15:13 Acknowledged.
+ }
+
const bool user_visible = manifest.gcm_user_visible_only ||
options.userVisibleOnly;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698