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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ 5 #ifndef CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_
6 #define CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ 6 #define CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/optional.h"
13 #include "base/strings/nullable_string16.h" 14 #include "base/strings/nullable_string16.h"
14 #include "base/strings/string_piece.h" 15 #include "base/strings/string_piece.h"
15 #include "content/common/content_export.h" 16 #include "content/common/content_export.h"
16 #include "content/public/common/manifest.h" 17 #include "content/public/common/manifest.h"
17 #include "content/renderer/manifest/manifest_debug_info.h" 18 #include "content/renderer/manifest/manifest_debug_info.h"
18 19
19 class GURL; 20 class GURL;
20 21
21 namespace base { 22 namespace base {
22 class DictionaryValue; 23 class DictionaryValue;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 std::vector<Manifest::Icon::IconPurpose> ParseIconPurpose( 140 std::vector<Manifest::Icon::IconPurpose> ParseIconPurpose(
140 const base::DictionaryValue& icon); 141 const base::DictionaryValue& icon);
141 142
142 // Parses the 'icons' field of a Manifest, as defined in: 143 // Parses the 'icons' field of a Manifest, as defined in:
143 // https://w3c.github.io/manifest/#dfn-steps-for-processing-an-array-of-images 144 // https://w3c.github.io/manifest/#dfn-steps-for-processing-an-array-of-images
144 // Returns a vector of Manifest::Icon with the successfully parsed icons, if 145 // Returns a vector of Manifest::Icon with the successfully parsed icons, if
145 // any. An empty vector if the field was not present or empty. 146 // any. An empty vector if the field was not present or empty.
146 std::vector<Manifest::Icon> ParseIcons( 147 std::vector<Manifest::Icon> ParseIcons(
147 const base::DictionaryValue& dictionary); 148 const base::DictionaryValue& dictionary);
148 149
150 // Parses the 'url_template' field of a Share Target, as defined in:
151 // https://github.com/WICG/web-share-target/blob/master/docs/interface.md
152 // Returns the parsed string if any, or a null string if the field was not
153 // present, or didn't contain a string.
154 base::NullableString16 ParseShareTargetURLTemplate(
155 const base::DictionaryValue& share_target);
156
157 // Parses the 'share_target' field of a Manifest, as defined in:
158 // https://github.com/WICG/web-share-target/blob/master/docs/interface.md
159 // Returns the parsed Web Share target. The returned Share Target is null if
160 // the field didn't exist, parsing failed, or it was empty.
161 base::Optional<Manifest::ShareTarget> ParseShareTarget(
162 const base::DictionaryValue& dictionary);
163
149 // Parses the 'platform' field of a related application, as defined in: 164 // Parses the 'platform' field of a related application, as defined in:
150 // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-platform-membe r-of-an-application 165 // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-platform-membe r-of-an-application
151 // Returns the parsed string if any, a null string if the parsing failed. 166 // Returns the parsed string if any, a null string if the parsing failed.
152 base::NullableString16 ParseRelatedApplicationPlatform( 167 base::NullableString16 ParseRelatedApplicationPlatform(
153 const base::DictionaryValue& application); 168 const base::DictionaryValue& application);
154 169
155 // Parses the 'url' field of a related application, as defined in: 170 // Parses the 'url' field of a related application, as defined in:
156 // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-url-member-of- an-application 171 // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-url-member-of- an-application
157 // Returns the paresed GURL if any, an empty GURL if the parsing failed. 172 // Returns the paresed GURL if any, an empty GURL if the parsing failed.
158 GURL ParseRelatedApplicationURL(const base::DictionaryValue& application); 173 GURL ParseRelatedApplicationURL(const base::DictionaryValue& application);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 bool failed_; 222 bool failed_;
208 Manifest manifest_; 223 Manifest manifest_;
209 std::vector<ManifestDebugInfo::Error> errors_; 224 std::vector<ManifestDebugInfo::Error> errors_;
210 225
211 DISALLOW_COPY_AND_ASSIGN(ManifestParser); 226 DISALLOW_COPY_AND_ASSIGN(ManifestParser);
212 }; 227 };
213 228
214 } // namespace content 229 } // namespace content
215 230
216 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ 231 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_
OLDNEW
« 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