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

Unified Diff: content/browser/notifications/notification_message_filter.cc

Issue 2507463003: Add kill switch for Notification images (Closed)
Patch Set: Rename test subclass Created 4 years, 1 month 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: content/browser/notifications/notification_message_filter.cc
diff --git a/content/browser/notifications/notification_message_filter.cc b/content/browser/notifications/notification_message_filter.cc
index 6efe1d2e65e86fe8f5f080df53b1919b3b58b630..bf9fe5635fac4f9dccd4c7b568924fa2d7a226df 100644
--- a/content/browser/notifications/notification_message_filter.cc
+++ b/content/browser/notifications/notification_message_filter.cc
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/command_line.h"
+#include "base/feature_list.h"
#include "content/browser/bad_message.h"
#include "content/browser/notifications/notification_id_generator.h"
#include "content/browser/notifications/page_notification_delegate.h"
@@ -22,6 +23,7 @@
#include "content/public/browser/platform_notification_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "third_party/WebKit/public/platform/modules/notifications/WebNotificationConstants.h"
@@ -51,10 +53,12 @@ PlatformNotificationData SanitizeNotificationData(
// Returns true when |resources| looks ok, false otherwise.
bool ValidateNotificationResources(const NotificationResources& resources) {
- // TODO(johnme): Remove this once https://crbug.com/614456 ships to stable.
+ // TODO(johnme): Remove the command line check once https://crbug.com/614456
+ // ships to stable.
if (!resources.image.drawsNothing() &&
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableExperimentalWebPlatformFeatures)) {
+ !(base::FeatureList::IsEnabled(features::kNotificationContentImage) &&
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExperimentalWebPlatformFeatures))) {
return false;
}
if (resources.image.width() > blink::kWebNotificationMaxImageWidthPx ||
« no previous file with comments | « chrome/browser/notifications/platform_notification_service_interactive_uitest.cc ('k') | content/child/runtime_features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698