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

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

Issue 770023002: Push registration should read a "gcm_user_visible_only" key from the Manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment fix Created 6 years 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: content/renderer/manifest/manifest_parser.h
diff --git a/content/renderer/manifest/manifest_parser.h b/content/renderer/manifest/manifest_parser.h
index 6e5f8a9a988eb8994bac7946b7e9151337a14357..2087efba0744e0ee3cfefd27684e7307be5d8b6c 100644
--- a/content/renderer/manifest/manifest_parser.h
+++ b/content/renderer/manifest/manifest_parser.h
@@ -50,6 +50,13 @@ class CONTENT_EXPORT ManifestParser {
const std::string& key,
TrimType trim);
+ // Helper function to parse booleans present on a given |dictionary| in a
+ // given field identified by its |key|.
+ // Returns the parsed boolean if any, or |default_value| is parsing failed.
mlamouri (slow - plz ping) 2014/12/01 21:05:09 nit: s/is parsing failed/if parsing failed/.
Peter Beverloo 2014/12/03 15:01:59 Done.
+ bool ParseBoolean(const base::DictionaryValue& dictionary,
+ const std::string& key,
+ bool default_value);
+
// Helper function to parse URLs present on a given |dictionary| in a given
// field identified by its |key|. The URL is first parsed as a string then
// resolved using |base_url|.
@@ -123,6 +130,11 @@ class CONTENT_EXPORT ManifestParser {
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);
+
const base::StringPiece& data_;
const GURL& manifest_url_;
const GURL& document_url_;

Powered by Google App Engine
This is Rietveld 408576698