OLD | NEW |
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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: | 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 | 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 | 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 | 137 // parsed icon purposes, and a vector with Manifest::Icon::IconPurpose::Any if |
138 // of type "string", and a vector containing Manifest::Icon::IconPurpose::Any | 138 // the parsing failed. |
139 // for all other parsing exceptions. | |
140 std::vector<Manifest::Icon::IconPurpose> ParseIconPurpose( | 139 std::vector<Manifest::Icon::IconPurpose> ParseIconPurpose( |
141 const base::DictionaryValue& icon); | 140 const base::DictionaryValue& icon); |
142 | 141 |
143 // Parses the 'icons' field of a Manifest, as defined in: | 142 // Parses the 'icons' field of a Manifest, as defined in: |
144 // https://w3c.github.io/manifest/#dfn-steps-for-processing-an-array-of-images | 143 // https://w3c.github.io/manifest/#dfn-steps-for-processing-an-array-of-images |
145 // Returns a vector of Manifest::Icon with the successfully parsed icons, if | 144 // Returns a vector of Manifest::Icon with the successfully parsed icons, if |
146 // any. An empty vector if the field was not present or empty. | 145 // any. An empty vector if the field was not present or empty. |
147 std::vector<Manifest::Icon> ParseIcons( | 146 std::vector<Manifest::Icon> ParseIcons( |
148 const base::DictionaryValue& dictionary); | 147 const base::DictionaryValue& dictionary); |
149 | 148 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 bool failed_; | 207 bool failed_; |
209 Manifest manifest_; | 208 Manifest manifest_; |
210 std::vector<ManifestDebugInfo::Error> errors_; | 209 std::vector<ManifestDebugInfo::Error> errors_; |
211 | 210 |
212 DISALLOW_COPY_AND_ASSIGN(ManifestParser); | 211 DISALLOW_COPY_AND_ASSIGN(ManifestParser); |
213 }; | 212 }; |
214 | 213 |
215 } // namespace content | 214 } // namespace content |
216 | 215 |
217 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ | 216 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ |
OLD | NEW |