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

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

Issue 2637003002: Add share_target field to Manifest. (Closed)
Patch Set: Changed share_target type to base::Optional, and fixed tests, according to feedback. Created 3 years, 11 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/public/common/manifest.cc ('k') | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/manifest/manifest_parser.h
diff --git a/content/renderer/manifest/manifest_parser.h b/content/renderer/manifest/manifest_parser.h
index 610566b4b8ddfe4ec1b52d93cb894cb11be38af2..0dfb1882409c85445a1fca61ab6a7e0c64de00a0 100644
--- a/content/renderer/manifest/manifest_parser.h
+++ b/content/renderer/manifest/manifest_parser.h
@@ -10,6 +10,7 @@
#include <memory>
#include "base/macros.h"
+#include "base/optional.h"
#include "base/strings/nullable_string16.h"
#include "base/strings/string_piece.h"
#include "content/common/content_export.h"
@@ -146,6 +147,20 @@ class CONTENT_EXPORT ManifestParser {
std::vector<Manifest::Icon> ParseIcons(
const base::DictionaryValue& dictionary);
+ // Parses the 'url_template' field of a Share Target, as defined in:
+ // https://github.com/WICG/web-share-target/blob/master/docs/interface.md
+ // Returns the parsed string if any, or a null string if the field was not
+ // present, or didn't contain a string.
+ base::NullableString16 ParseShareTargetURLTemplate(
+ const base::DictionaryValue& share_target);
+
+ // Parses the 'share_target' field of a Manifest, as defined in:
+ // https://github.com/WICG/web-share-target/blob/master/docs/interface.md
+ // Returns the parsed Web Share target. The returned Share Target is null if
+ // the field didn't exist, parsing failed, or it was empty.
+ base::Optional<Manifest::ShareTarget> ParseShareTarget(
+ 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 the parsed string if any, a null string if the parsing failed.
« no previous file with comments | « content/public/common/manifest.cc ('k') | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698