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

Side by Side Diff: content/renderer/manifest/manifest_parser.h

Issue 2425833002: Parse "purpose" member from Web Manifest (Closed)
Patch Set: Fix Created 4 years 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.h ('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>
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Returns the parsed string if any, an empty string if the parsing failed. 124 // Returns the parsed string if any, an empty string if the parsing failed.
125 base::string16 ParseIconType(const base::DictionaryValue& icon); 125 base::string16 ParseIconType(const base::DictionaryValue& icon);
126 126
127 // Parses the 'sizes' field of an icon, as defined in: 127 // Parses the 'sizes' field of an icon, as defined in:
128 // https://w3c.github.io/manifest/#dfn-steps-for-processing-a-sizes-member-of- an-image 128 // https://w3c.github.io/manifest/#dfn-steps-for-processing-a-sizes-member-of- an-image
129 // Returns a vector of gfx::Size with the successfully parsed sizes, if any. 129 // Returns a vector of gfx::Size with the successfully parsed sizes, if any.
130 // An empty vector if the field was not present or empty. "Any" is represented 130 // An empty vector if the field was not present or empty. "Any" is represented
131 // by gfx::Size(0, 0). 131 // by gfx::Size(0, 0).
132 std::vector<gfx::Size> ParseIconSizes(const base::DictionaryValue& icon); 132 std::vector<gfx::Size> ParseIconSizes(const base::DictionaryValue& icon);
133 133
134 // Parses the 'purpose' field of an icon, as defined in:
135 // https://w3c.github.io/manifest/#dfn-steps-for-processing-a-purpose-member-o f-an-image
136 // Returns a vector of Manifest::Icon::IconPurpose with the successfully
137 // parsed icon purposes, an empty vector if the field was not present or not
138 // of type "string", and a vector containing Manifest::Icon::IconPurpose::Any
139 // for all other parsing exceptions.
140 std::vector<Manifest::Icon::IconPurpose> ParseIconPurpose(
141 const base::DictionaryValue& icon);
142
134 // Parses the 'icons' field of a Manifest, as defined in: 143 // Parses the 'icons' field of a Manifest, as defined in:
135 // 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
136 // 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
137 // 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.
138 std::vector<Manifest::Icon> ParseIcons( 147 std::vector<Manifest::Icon> ParseIcons(
139 const base::DictionaryValue& dictionary); 148 const base::DictionaryValue& dictionary);
140 149
141 // Parses the 'platform' field of a related application, as defined in: 150 // Parses the 'platform' field of a related application, as defined in:
142 // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-platform-membe r-of-an-application 151 // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-platform-membe r-of-an-application
143 // Returns the parsed string if any, a null string if the parsing failed. 152 // Returns the parsed string if any, a null string if the parsing failed.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 bool failed_; 208 bool failed_;
200 Manifest manifest_; 209 Manifest manifest_;
201 std::vector<ManifestDebugInfo::Error> errors_; 210 std::vector<ManifestDebugInfo::Error> errors_;
202 211
203 DISALLOW_COPY_AND_ASSIGN(ManifestParser); 212 DISALLOW_COPY_AND_ASSIGN(ManifestParser);
204 }; 213 };
205 214
206 } // namespace content 215 } // namespace content
207 216
208 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ 217 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_
OLDNEW
« no previous file with comments | « content/public/common/manifest.h ('k') | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698