| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // Parses the 'src' field of an icon, as defined in: | 119 // Parses the 'src' field of an icon, as defined in: |
| 120 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-src-member-of-a
n-icon | 120 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-src-member-of-a
n-icon |
| 121 // Returns the parsed GURL if any, an empty GURL if the parsing failed. | 121 // Returns the parsed GURL if any, an empty GURL if the parsing failed. |
| 122 GURL ParseIconSrc(const base::DictionaryValue& icon); | 122 GURL ParseIconSrc(const base::DictionaryValue& icon); |
| 123 | 123 |
| 124 // Parses the 'type' field of an icon, as defined in: | 124 // Parses the 'type' field of an icon, as defined in: |
| 125 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-type-member-of-
an-icon | 125 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-type-member-of-
an-icon |
| 126 // Returns the parsed string if any, a null string if the parsing failed. | 126 // Returns the parsed string if any, a null string if the parsing failed. |
| 127 base::NullableString16 ParseIconType(const base::DictionaryValue& icon); | 127 base::NullableString16 ParseIconType(const base::DictionaryValue& icon); |
| 128 | 128 |
| 129 // Parses the 'density' field of an icon, as defined in: | |
| 130 // http://w3c.github.io/manifest/#dfn-steps-for-processing-a-density-member-of
-an-icon | |
| 131 // Returns the parsed double if any, Manifest::Icon::kDefaultDensity if the | |
| 132 // parsing failed. | |
| 133 double ParseIconDensity(const base::DictionaryValue& icon); | |
| 134 | |
| 135 // Parses the 'sizes' field of an icon, as defined in: | 129 // Parses the 'sizes' field of an icon, as defined in: |
| 136 // http://w3c.github.io/manifest/#dfn-steps-for-processing-a-sizes-member-of-a
n-icon | 130 // http://w3c.github.io/manifest/#dfn-steps-for-processing-a-sizes-member-of-a
n-icon |
| 137 // Returns a vector of gfx::Size with the successfully parsed sizes, if any. | 131 // Returns a vector of gfx::Size with the successfully parsed sizes, if any. |
| 138 // An empty vector if the field was not present or empty. "Any" is represented | 132 // An empty vector if the field was not present or empty. "Any" is represented |
| 139 // by gfx::Size(0, 0). | 133 // by gfx::Size(0, 0). |
| 140 std::vector<gfx::Size> ParseIconSizes(const base::DictionaryValue& icon); | 134 std::vector<gfx::Size> ParseIconSizes(const base::DictionaryValue& icon); |
| 141 | 135 |
| 142 // Parses the 'icons' field of a Manifest, as defined in: | 136 // Parses the 'icons' field of a Manifest, as defined in: |
| 143 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-icons-member | 137 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-icons-member |
| 144 // Returns a vector of Manifest::Icon with the successfully parsed icons, if | 138 // Returns a vector of Manifest::Icon with the successfully parsed icons, if |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 bool failed_; | 200 bool failed_; |
| 207 Manifest manifest_; | 201 Manifest manifest_; |
| 208 std::vector<std::unique_ptr<ErrorInfo>> errors_; | 202 std::vector<std::unique_ptr<ErrorInfo>> errors_; |
| 209 | 203 |
| 210 DISALLOW_COPY_AND_ASSIGN(ManifestParser); | 204 DISALLOW_COPY_AND_ASSIGN(ManifestParser); |
| 211 }; | 205 }; |
| 212 | 206 |
| 213 } // namespace content | 207 } // namespace content |
| 214 | 208 |
| 215 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ | 209 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ |
| OLD | NEW |