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

Unified Diff: chrome/renderer/manifest/manifest_parser.h

Issue 936413003: Allow extensions of the ManifestParser outside of the content/ layer. (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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/manifest/manifest_parser.h
diff --git a/chrome/renderer/manifest/manifest_parser.h b/chrome/renderer/manifest/manifest_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..4bd8db39116d2e447be720ad5dc3561396a82a63
--- /dev/null
+++ b/chrome/renderer/manifest/manifest_parser.h
@@ -0,0 +1,35 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_MANIFEST_MANIFEST_PARSER_H_
+#define CHROME_RENDERER_MANIFEST_MANIFEST_PARSER_H_
+
+#include "content/public/renderer/manifest_parser.h"
+
+// ChromeManifestParser is an extension of the Manifest parser handling
+// properties specific to Chrome and unknown to the content/ layer.
+class ChromeManifestParser : public content::ManifestParser {
+ public:
+ ChromeManifestParser();
+ ~ChromeManifestParser() override;
+
+ protected:
+ void ParseExtensionPoint(const base::DictionaryValue& dictionary) override;
+
+ private:
+ // Parses the 'gcm_sender_id' field of the manifest.
+ // This is a proprietary extension of the Web Manifest specification.
+ // Returns the parsed string if any, a null string if the parsing failed.
+ base::NullableString16 ParseGCMSenderID(
+ const base::DictionaryValue& dictionary);
+
+ // Parses the 'gcm_user_visible_only' field of the manifest.
+ // This is a proprietary extension of the Web Manifest specification.
+ // Returns true iff the string could be parsed as the boolean true.
+ bool ParseGCMUserVisibleOnly(const base::DictionaryValue& dictionary);
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeManifestParser);
+};
+
+#endif // CHROME_RENDERER_MANIFEST_MANIFEST_PARSER_H_

Powered by Google App Engine
This is Rietveld 408576698