1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/public/common/manifest.h"
9 const double Manifest::Icon::kDefaultDensity
= 1;
10 // We need to provide a value here which is out of the range of a 32-bit integer
11 // since otherwise we would not be able to check whether a theme color was valid
12 // or not. The simplest way to do this is to simply add one to the maximum
13 // possible 32-bit integer.
14 const int64_t Manifest::kInvalidOrMissingThemeColor
=
15 static_cast<int64_t>(std::numeric_limits
<int32_t>::max()) + 1;
16 const size_t Manifest::kMaxIPCStringLength
= 4 * 1024;
18 Manifest::Icon::Icon()
19 : density(kDefaultDensity
) {
22 Manifest::Icon::~Icon() {
25 Manifest::RelatedApplication::RelatedApplication() {
28 Manifest::RelatedApplication::~RelatedApplication() {
32 : display(DISPLAY_MODE_UNSPECIFIED
),
33 orientation(blink::WebScreenOrientationLockDefault
),
34 prefer_related_applications(false),
35 theme_color(Manifest::kInvalidOrMissingThemeColor
) {
38 Manifest::~Manifest() {
41 bool Manifest::IsEmpty() const {
42 return name
.is_null() &&
43 short_name
.is_null() &&
44 start_url
.is_empty() &&
45 display
== DISPLAY_MODE_UNSPECIFIED
&&
46 orientation
== blink::WebScreenOrientationLockDefault
&&
48 related_applications
.empty() &&
49 !prefer_related_applications
&&
50 theme_color
== Manifest::kInvalidOrMissingThemeColor
&&
51 gcm_sender_id
.is_null();
54 } // namespace content