Index: content/renderer/manifest/manifest_parser.cc |
diff --git a/content/renderer/manifest/manifest_parser.cc b/content/renderer/manifest/manifest_parser.cc |
index 961ab3742cd32e27340a779b734701429778156b..9a3e8520932cc7d18b6054066deda1d8f0a65c29 100644 |
--- a/content/renderer/manifest/manifest_parser.cc |
+++ b/content/renderer/manifest/manifest_parser.cc |
@@ -128,6 +128,7 @@ void ManifestParser::Parse() { |
manifest_.orientation = ParseOrientation(*dictionary); |
manifest_.icons = ParseIcons(*dictionary); |
manifest_.gcm_sender_id = ParseGCMSenderID(*dictionary); |
+ manifest_.gcm_user_visible_only = ParseGCMUserVisibleOnly(*dictionary); |
ManifestUmaUtil::ParseSucceeded(manifest_); |
} |
@@ -144,6 +145,22 @@ bool ManifestParser::failed() const { |
return failed_; |
} |
+bool ManifestParser::ParseBoolean(const base::DictionaryValue& dictionary, |
+ const std::string& key, |
+ bool default_value) { |
+ if (!dictionary.HasKey(key)) |
+ return default_value; |
+ |
+ bool value; |
+ if (!dictionary.GetBoolean(key, &value)) { |
+ errors_.push_back(GetErrorPrefix() + |
+ "property '" + key + "' ignored, type boolean expected."); |
+ return default_value; |
+ } |
+ |
+ return value; |
+} |
+ |
base::NullableString16 ManifestParser::ParseString( |
const base::DictionaryValue& dictionary, |
const std::string& key, |
@@ -322,4 +339,9 @@ base::NullableString16 ManifestParser::ParseGCMSenderID( |
return ParseString(dictionary, "gcm_sender_id", Trim); |
} |
+bool ManifestParser::ParseGCMUserVisibleOnly( |
+ const base::DictionaryValue& dictionary) { |
+ return ParseBoolean(dictionary, "gcm_user_visible_only", false); |
+} |
+ |
} // namespace content |