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

Unified Diff: content/public/common/manifest.cc

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.h ('k') | content/renderer/manifest/manifest_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/manifest.cc
diff --git a/content/public/common/manifest.cc b/content/public/common/manifest.cc
index 8e09aad2e71ea9aa86f681d7df267f2dbbddb09c..e0c9cfc4fd1cc92fa3d5df51065d16449110c941 100644
--- a/content/public/common/manifest.cc
+++ b/content/public/common/manifest.cc
@@ -6,12 +6,6 @@
namespace content {
-// We need to provide a value here which is out of the range of a 32-bit integer
-// since otherwise we would not be able to check whether a theme color was valid
-// or not. The simplest way to do this is to simply add one to the maximum
-// possible 32-bit integer.
-const int64_t Manifest::kInvalidOrMissingColor =
- static_cast<int64_t>(std::numeric_limits<int32_t>::max()) + 1;
const size_t Manifest::kMaxIPCStringLength = 4 * 1024;
Manifest::Icon::Icon() { }
@@ -34,9 +28,7 @@ Manifest::RelatedApplication::~RelatedApplication() {
Manifest::Manifest()
: display(blink::WebDisplayModeUndefined),
orientation(blink::WebScreenOrientationLockDefault),
- prefer_related_applications(false),
- theme_color(Manifest::kInvalidOrMissingColor),
- background_color(Manifest::kInvalidOrMissingColor) {
+ prefer_related_applications(false) {
}
Manifest::Manifest(const Manifest& other) = default;
@@ -53,8 +45,8 @@ bool Manifest::IsEmpty() const {
icons.empty() &&
related_applications.empty() &&
!prefer_related_applications &&
- theme_color == Manifest::kInvalidOrMissingColor &&
- background_color == Manifest::kInvalidOrMissingColor &&
+ !theme_color.has_value() &&
+ !background_color.has_value() &&
gcm_sender_id.is_null() &&
scope.is_empty();
}
« no previous file with comments | « content/public/common/manifest.h ('k') | content/renderer/manifest/manifest_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698