Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / public / common / manifest.cc
blob744be0ec3a5f06b2ef41a02df9d2a7867671164c
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"
7 namespace content {
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::kInvalidOrMissingColor =
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() {
31 Manifest::Manifest()
32 : display(blink::WebDisplayModeUndefined),
33 orientation(blink::WebScreenOrientationLockDefault),
34 prefer_related_applications(false),
35 theme_color(Manifest::kInvalidOrMissingColor),
36 background_color(Manifest::kInvalidOrMissingColor) {
39 Manifest::~Manifest() {
42 bool Manifest::IsEmpty() const {
43 return name.is_null() &&
44 short_name.is_null() &&
45 start_url.is_empty() &&
46 display == blink::WebDisplayModeUndefined &&
47 orientation == blink::WebScreenOrientationLockDefault &&
48 icons.empty() &&
49 related_applications.empty() &&
50 !prefer_related_applications &&
51 theme_color == Manifest::kInvalidOrMissingColor &&
52 background_color == Manifest::kInvalidOrMissingColor &&
53 gcm_sender_id.is_null();
56 } // namespace content