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

Unified Diff: content/public/common/manifest.h

Issue 590563002: Add support for icons.{src,type,density} in Manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: EXPORT Manifest::Icon Created 6 years, 3 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 | « content/common/manifest_manager_messages.h ('k') | content/public/common/manifest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/manifest.h
diff --git a/content/public/common/manifest.h b/content/public/common/manifest.h
index 35a49b138a68b490365b8cd93e0b0eb55952d9d5..949c6100446657f66d48dc9f009351757fc65265 100644
--- a/content/public/common/manifest.h
+++ b/content/public/common/manifest.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_PUBLIC_COMMON_MANIFEST_H_
#define CONTENT_PUBLIC_COMMON_MANIFEST_H_
+#include <vector>
+
#include "base/strings/nullable_string16.h"
#include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
@@ -24,6 +26,29 @@ struct CONTENT_EXPORT Manifest {
DISPLAY_MODE_BROWSER
};
+ // Structure representing an icon as per the Manifest specification, see:
+ // http://w3c.github.io/manifest/#dfn-icon-object
+ struct CONTENT_EXPORT Icon {
+ Icon();
+ ~Icon();
+
+ // MUST be a valid url. If an icon doesn't have a valid URL, it will not be
+ // successfully parsed, thus will not be represented in the Manifest.
+ GURL src;
+
+ // Null if the parsing failed or the field was not present. The type can be
+ // any string and doesn't have to be a valid image MIME type at this point.
+ // It is up to the consumer of the object to check if the type matches a
+ // supported type.
+ base::NullableString16 type;
+
+ // Default value is 1.0 if the value is missing or invalid.
+ double density;
+
+ // Default density. Set to 1.0.
+ static const double kDefaultDensity;
+ };
+
Manifest();
~Manifest();
@@ -48,6 +73,10 @@ struct CONTENT_EXPORT Manifest {
// field was not present.
blink::WebScreenOrientationLockType orientation;
+ // Empty if the parsing failed, the field was not present, empty or all the
+ // icons inside the JSON array were invalid.
+ std::vector<Icon> icons;
+
// Maximum length for all the strings inside the Manifest when it is sent over
// IPC. The renderer process should truncate the strings before sending the
// Manifest and the browser process must do the same when receiving it.
« no previous file with comments | « content/common/manifest_manager_messages.h ('k') | content/public/common/manifest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698