| 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> |
| 9 |
| 8 #include "base/strings/nullable_string16.h" | 10 #include "base/strings/nullable_string16.h" |
| 9 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
| 10 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 11 #include "content/public/common/manifest.h" | 13 #include "content/public/common/manifest.h" |
| 12 | 14 |
| 13 class GURL; | 15 class GURL; |
| 14 | 16 |
| 15 namespace base { | 17 namespace base { |
| 16 class DictionaryValue; | 18 class DictionaryValue; |
| 17 } | 19 } |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // or empty. | 150 // or empty. |
| 149 std::vector<Manifest::RelatedApplication> ParseRelatedApplications( | 151 std::vector<Manifest::RelatedApplication> ParseRelatedApplications( |
| 150 const base::DictionaryValue& dictionary); | 152 const base::DictionaryValue& dictionary); |
| 151 | 153 |
| 152 // Parses the 'prefer_related_applications' field on the manifest, as defined | 154 // Parses the 'prefer_related_applications' field on the manifest, as defined |
| 153 // in: | 155 // in: |
| 154 // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-prefer_related
_applications-member | 156 // https://w3c.github.io/manifest/#dfn-steps-for-processing-the-prefer_related
_applications-member |
| 155 // returns true iff the field could be parsed as the boolean true. | 157 // returns true iff the field could be parsed as the boolean true. |
| 156 bool ParsePreferRelatedApplications(const base::DictionaryValue& dictionary); | 158 bool ParsePreferRelatedApplications(const base::DictionaryValue& dictionary); |
| 157 | 159 |
| 160 // Parses the 'theme_color' field of the manifest, as defined in: |
| 161 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-theme_color-mem
ber |
| 162 // Returns the parsed theme color if any, |
| 163 // Manifest::kInvalidOrMissingThemeColor if the parsing failed. |
| 164 int64_t ParseThemeColor(const base::DictionaryValue& dictionary); |
| 165 |
| 158 // Parses the 'gcm_sender_id' field of the manifest. | 166 // Parses the 'gcm_sender_id' field of the manifest. |
| 159 // This is a proprietary extension of the Web Manifest specification. | 167 // This is a proprietary extension of the Web Manifest specification. |
| 160 // Returns the parsed string if any, a null string if the parsing failed. | 168 // Returns the parsed string if any, a null string if the parsing failed. |
| 161 base::NullableString16 ParseGCMSenderID( | 169 base::NullableString16 ParseGCMSenderID( |
| 162 const base::DictionaryValue& dictionary); | 170 const base::DictionaryValue& dictionary); |
| 163 | 171 |
| 164 const base::StringPiece& data_; | 172 const base::StringPiece& data_; |
| 165 GURL manifest_url_; | 173 GURL manifest_url_; |
| 166 GURL document_url_; | 174 GURL document_url_; |
| 167 | 175 |
| 168 bool failed_; | 176 bool failed_; |
| 169 Manifest manifest_; | 177 Manifest manifest_; |
| 170 std::vector<std::string> errors_; | 178 std::vector<std::string> errors_; |
| 171 | 179 |
| 172 DISALLOW_COPY_AND_ASSIGN(ManifestParser); | 180 DISALLOW_COPY_AND_ASSIGN(ManifestParser); |
| 173 }; | 181 }; |
| 174 | 182 |
| 175 } // namespace content | 183 } // namespace content |
| 176 | 184 |
| 177 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ | 185 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ |
| OLD | NEW |