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

Unified Diff: chrome/browser/banners/app_banner_data_fetcher.cc

Issue 1829643002: App Banner: require 'display' to be set to 'standalone' or 'fullscreen'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/banners/app_banner_data_fetcher.cc
diff --git a/chrome/browser/banners/app_banner_data_fetcher.cc b/chrome/browser/banners/app_banner_data_fetcher.cc
index 25e766096e8727dd99450eaac3d02a87d4b82857..f8dba02a06f931739a47e6e59bd8c64152e9502e 100644
--- a/chrome/browser/banners/app_banner_data_fetcher.cc
+++ b/chrome/browser/banners/app_banner_data_fetcher.cc
@@ -25,6 +25,7 @@
#include "content/public/browser/service_worker_context.h"
#include "content/public/browser/storage_partition.h"
#include "net/base/load_flags.h"
+#include "third_party/WebKit/public/platform/WebDisplayMode.h"
#include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerPromptReply.h"
#include "ui/gfx/screen.h"
@@ -449,11 +450,20 @@ bool AppBannerDataFetcher::IsManifestValidForWebApp(
is_debug_mode);
return false;
}
- if (manifest.name.is_null() && manifest.short_name.is_null()) {
+ if ((manifest.name.is_null() || manifest.name.string().empty()) &&
+ (manifest.short_name.is_null() || manifest.short_name.string().empty())) {
OutputDeveloperNotShownMessage(
web_contents, kManifestMissingNameOrShortName, is_debug_mode);
return false;
}
+
+ if (manifest.display != blink::WebDisplayModeStandalone &&
+ manifest.display != blink::WebDisplayModeFullscreen) {
+ OutputDeveloperNotShownMessage(
+ web_contents, kManifestDisplayStandaloneFullscreen, is_debug_mode);
+ return false;
+ }
+
if (!DoesManifestContainRequiredIcon(manifest)) {
OutputDeveloperNotShownMessage(web_contents, kManifestMissingSuitableIcon,
is_debug_mode);

Powered by Google App Engine
This is Rietveld 408576698