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

Unified Diff: content/renderer/manifest/manifest_parser.h

Issue 919293002: Add related_applications field to manifest parser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update for additions to spec Created 5 years, 8 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: content/renderer/manifest/manifest_parser.h
diff --git a/content/renderer/manifest/manifest_parser.h b/content/renderer/manifest/manifest_parser.h
index 931bd8737fe0a381b84a8fd4a0bf1e5a34b30897..82fb6120a9911f456905bf163606d619966c4c2b 100644
--- a/content/renderer/manifest/manifest_parser.h
+++ b/content/renderer/manifest/manifest_parser.h
@@ -124,6 +124,38 @@ class CONTENT_EXPORT ManifestParser {
std::vector<Manifest::Icon> ParseIcons(
const base::DictionaryValue& dictionary);
+ // Parses the 'platform' field of a related application, as defined in:
+ // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-platform-member-of-an-application
+ // Returns RELATED_APPLICATION_PLATFORM_UNSPECIFIED if the parsing
+ // failed.
+ Manifest::RelatedApplicationPlatform ParseRelatedApplicationPlatform(
+ const base::DictionaryValue& application);
mlamouri (slow - plz ping) 2015/04/10 09:49:45 The spec say it should return a string.
benwells 2015/04/15 06:45:22 Done.
+
+ // Parses the 'url' field of a related application, as defined in:
+ // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-url-member-of-an-application
+ // Returns the paresed GURL if any, an empty GURL if the parsing failed.
+ GURL ParseRelatedApplicationURL(const base::DictionaryValue& application);
+
+ // Parses the 'id' field of a related application, as defined in:
+ // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-id-member-of-an-application
+ // Returns the parsed string if any, a null string if the parsing failed.
+ base::NullableString16 ParseRelatedApplicationId(
+ const base::DictionaryValue& application);
+
+ // Parses the 'related_applications' field of the manifest, as defined in:
+ // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-related_applications-member
+ // Returns a vector of Manifest::RelatedApplication with the successfully
+ // parsed applications, if any. An empty vector if the field was not present
+ // or empty.
+ std::vector<Manifest::RelatedApplication> ParseRelatedApplications(
+ const base::DictionaryValue& dictionary);
+
+ // Parses the 'prefer_related_applications' field on the manifest, as defined
+ // in:
+ // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-prefer_related_applications-member
+ // returns true iff the field could be parsed as the boolean true.
+ bool ParsePreferRelatedApplications(const base::DictionaryValue& dictionary);
+
// Parses the 'gcm_sender_id' field of the manifest.
// This is a proprietary extension of the Web Manifest specification.
// Returns the parsed string if any, a null string if the parsing failed.

Powered by Google App Engine
This is Rietveld 408576698