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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-short-name-memb er | 76 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-short-name-memb er |
75 // Returns the parsed string if any, a null string if the parsing failed. | 77 // Returns the parsed string if any, a null string if the parsing failed. |
76 base::NullableString16 ParseShortName( | 78 base::NullableString16 ParseShortName( |
77 const base::DictionaryValue& dictionary); | 79 const base::DictionaryValue& dictionary); |
78 | 80 |
79 // Parses the 'start_url' field of the manifest, as defined in: | 81 // Parses the 'start_url' field of the manifest, as defined in: |
80 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-start_url-membe r | 82 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-start_url-membe r |
81 // Returns the parsed GURL if any, an empty GURL if the parsing failed. | 83 // Returns the parsed GURL if any, an empty GURL if the parsing failed. |
82 GURL ParseStartURL(const base::DictionaryValue& dictionary); | 84 GURL ParseStartURL(const base::DictionaryValue& dictionary); |
83 | 85 |
86 // Parses the 'theme_color' field of the manifest, as defined in: | |
87 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-theme_color-mem ber | |
88 // Returns the parsed theme color if any, -1 if the parsing failed. | |
mlamouri (slow - plz ping)
2015/07/16 12:35:41
Replace -1 with kInvalidOrMissingThemeColor.
Lalit Maganti
2015/07/16 14:49:02
Done.
| |
89 int64_t ParseThemeColor(const base::DictionaryValue& dictionary); | |
90 | |
84 // Parses the 'display' field of the manifest, as defined in: | 91 // Parses the 'display' field of the manifest, as defined in: |
85 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-display-member | 92 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-display-member |
86 // Returns the parsed DisplayMode if any, DISPLAY_MODE_UNSPECIFIED if the | 93 // Returns the parsed DisplayMode if any, DISPLAY_MODE_UNSPECIFIED if the |
87 // parsing failed. | 94 // parsing failed. |
88 Manifest::DisplayMode ParseDisplay(const base::DictionaryValue& dictionary); | 95 Manifest::DisplayMode ParseDisplay(const base::DictionaryValue& dictionary); |
89 | 96 |
90 // Parses the 'orientation' field of the manifest, as defined in: | 97 // Parses the 'orientation' field of the manifest, as defined in: |
91 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-orientation-mem ber | 98 // http://w3c.github.io/manifest/#dfn-steps-for-processing-the-orientation-mem ber |
92 // Returns the parsed WebScreenOrientationLockType if any, | 99 // Returns the parsed WebScreenOrientationLockType if any, |
93 // WebScreenOrientationLockDefault if the parsing failed. | 100 // WebScreenOrientationLockDefault if the parsing failed. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 bool failed_; | 175 bool failed_; |
169 Manifest manifest_; | 176 Manifest manifest_; |
170 std::vector<std::string> errors_; | 177 std::vector<std::string> errors_; |
171 | 178 |
172 DISALLOW_COPY_AND_ASSIGN(ManifestParser); | 179 DISALLOW_COPY_AND_ASSIGN(ManifestParser); |
173 }; | 180 }; |
174 | 181 |
175 } // namespace content | 182 } // namespace content |
176 | 183 |
177 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ | 184 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ |
OLD | NEW |