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

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

Issue 919293002: Add related_applications field to manifest parser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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
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 "base/strings/nullable_string16.h" 8 #include "base/strings/nullable_string16.h"
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // This is a proprietary extension of the Web Manifest specification. 128 // This is a proprietary extension of the Web Manifest specification.
129 // Returns the parsed string if any, a null string if the parsing failed. 129 // Returns the parsed string if any, a null string if the parsing failed.
130 base::NullableString16 ParseGCMSenderID( 130 base::NullableString16 ParseGCMSenderID(
131 const base::DictionaryValue& dictionary); 131 const base::DictionaryValue& dictionary);
132 132
133 // Parses the 'gcm_user_visible_only' field of the manifest. 133 // Parses the 'gcm_user_visible_only' field of the manifest.
134 // This is a proprietary extension of the Web Manifest specification. 134 // This is a proprietary extension of the Web Manifest specification.
135 // Returns true iff the string could be parsed as the boolean true. 135 // Returns true iff the string could be parsed as the boolean true.
136 bool ParseGCMUserVisibleOnly(const base::DictionaryValue& dictionary); 136 bool ParseGCMUserVisibleOnly(const base::DictionaryValue& dictionary);
137 137
138 // Parses the platform field of a related application.
139 // Returns RELATED_APPLICATION_PLATFORM_UNSPECIFIED if the parsing failed.
140 Manifest::RelatedApplicationPlatform ParseRelatedApplicationPlatform(
mlamouri (slow - plz ping) 2015/02/16 20:20:40 nit: maybe prefix with Chrome?
benwells 2015/02/16 23:58:43 Done.
141 const base::DictionaryValue& application);
142
143 // Parses the id field of a related application.
144 // Returns the parsed string if any, a null string if the parsing failed.
145 base::NullableString16 ParseRelatedApplicationId(
mlamouri (slow - plz ping) 2015/02/16 20:20:40 ditto
benwells 2015/02/16 23:58:43 Done.
146 const base::DictionaryValue& application);
147
148 // Parses the 'chrome_related_applications' field of the manifest.
149 // Returns a vector of Manifest::RelatedApplication with the successfully
150 // parsed applications, if any. An empty vector if the field was not present
151 // or empty.
152 std::vector<Manifest::RelatedApplication> ParseChromeRelatedApplications(
153 const base::DictionaryValue& dictionary);
154
138 const base::StringPiece& data_; 155 const base::StringPiece& data_;
139 GURL manifest_url_; 156 GURL manifest_url_;
140 GURL document_url_; 157 GURL document_url_;
141 158
142 bool failed_; 159 bool failed_;
143 Manifest manifest_; 160 Manifest manifest_;
144 std::vector<std::string> errors_; 161 std::vector<std::string> errors_;
145 162
146 DISALLOW_COPY_AND_ASSIGN(ManifestParser); 163 DISALLOW_COPY_AND_ASSIGN(ManifestParser);
147 }; 164 };
148 165
149 } // namespace content 166 } // namespace content
150 167
151 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ 168 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698