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

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: Do IPC stuff 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 CHROME_RELATED_APPLICATION_PLATFORM_UNSPECIFIED if the parsing
140 // failed.
141 Manifest::ChromeRelatedApplicationPlatform
142 ParseChromeRelatedApplicationPlatform(
143 const base::DictionaryValue& application);
144
145 // Parses the id field of a related application.
146 // Returns the parsed string if any, a null string if the parsing failed.
147 base::NullableString16 ParseChromeRelatedApplicationId(
148 const base::DictionaryValue& application);
149
150 // Parses the 'chrome_related_applications' field of the manifest.
151 // Returns a vector of Manifest::RelatedApplication with the successfully
152 // parsed applications, if any. An empty vector if the field was not present
153 // or empty.
154 std::vector<Manifest::ChromeRelatedApplication>
155 ParseChromeRelatedApplications(
156 const base::DictionaryValue& dictionary);
157
138 const base::StringPiece& data_; 158 const base::StringPiece& data_;
139 GURL manifest_url_; 159 GURL manifest_url_;
140 GURL document_url_; 160 GURL document_url_;
141 161
142 bool failed_; 162 bool failed_;
143 Manifest manifest_; 163 Manifest manifest_;
144 std::vector<std::string> errors_; 164 std::vector<std::string> errors_;
145 165
146 DISALLOW_COPY_AND_ASSIGN(ManifestParser); 166 DISALLOW_COPY_AND_ASSIGN(ManifestParser);
147 }; 167 };
148 168
149 } // namespace content 169 } // namespace content
150 170
151 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_ 171 #endif // CONTENT_RENDERER_MANIFEST_MANIFEST_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698