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

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

Issue 2036803002: [WIP] Use Optional<SkColor> instead of int64 for colors in Manifest. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: with unit tests Created 4 years, 5 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
« no previous file with comments | « content/public/common/manifest.cc ('k') | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/manifest/manifest_parser.h
diff --git a/content/renderer/manifest/manifest_parser.h b/content/renderer/manifest/manifest_parser.h
index 2c8d2076e33075824469ae3e04ead46d83515387..8be1d5d06cdc415b63df512ab943bbc3df803126 100644
--- a/content/renderer/manifest/manifest_parser.h
+++ b/content/renderer/manifest/manifest_parser.h
@@ -66,10 +66,10 @@ class CONTENT_EXPORT ManifestParser {
// Helper function to parse colors present on a given |dictionary| in a given
// field identified by its |key|.
- // Returns the parsed color as an int64_t if any,
- // Manifest::kInvalidOrMissingColor if the parsing failed.
- int64_t ParseColor(const base::DictionaryValue& dictionary,
- const std::string& key);
+ // Returns the parsed color as Optional<SkColor>; if the parsing failed, the
+ // Optional<> will be empty.
+ base::Optional<SkColor> ParseColor(const base::DictionaryValue& dictionary,
+ const std::string& key);
// 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
@@ -171,15 +171,17 @@ class CONTENT_EXPORT ManifestParser {
// Parses the 'theme_color' field of the manifest, as defined in:
// http://w3c.github.io/manifest/#dfn-steps-for-processing-the-theme_color-member
- // Returns the parsed theme color if any,
- // Manifest::kInvalidOrMissingColor if the parsing failed.
- int64_t ParseThemeColor(const base::DictionaryValue& dictionary);
+ // Returns the parsed theme color wrapped in an Optional<> if any, empty
+ // Optional<> if the parsing failed.
+ base::Optional<SkColor> ParseThemeColor(
+ const base::DictionaryValue& dictionary);
// Parses the 'background_color' field of the manifest, as defined in:
// http://w3c.github.io/manifest/#dfn-steps-for-processing-the-background_color-member
- // Returns the parsed background color if any,
- // Manifest::kInvalidOrMissingColor if the parsing failed.
- int64_t ParseBackgroundColor(const base::DictionaryValue& dictionary);
+ // Returns the parsed background color wrapped in an Optional<> if any, empty
+ // Optional<> if the parsing failed.
+ base::Optional<SkColor> ParseBackgroundColor(
+ const base::DictionaryValue& dictionary);
// Parses the 'gcm_sender_id' field of the manifest.
// This is a proprietary extension of the Web Manifest specification.
« no previous file with comments | « content/public/common/manifest.cc ('k') | content/renderer/manifest/manifest_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698