OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/public/common/manifest.h" | 5 #include "content/public/common/manifest.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 // We need to provide a value here which is out of the range of a 32-bit integer | 9 // We need to provide a value here which is out of the range of a 32-bit integer |
10 // since otherwise we would not be able to check whether a theme color was valid | 10 // since otherwise we would not be able to check whether a theme color was valid |
11 // or not. The simplest way to do this is to simply add one to the maximum | 11 // or not. The simplest way to do this is to simply add one to the maximum |
12 // possible 32-bit integer. | 12 // possible 32-bit integer. |
13 const int64_t Manifest::kInvalidOrMissingColor = | 13 const int64_t Manifest::kInvalidOrMissingColor = |
14 static_cast<int64_t>(std::numeric_limits<int32_t>::max()) + 1; | 14 static_cast<int64_t>(std::numeric_limits<int32_t>::max()) + 1; |
15 const size_t Manifest::kMaxIPCStringLength = 4 * 1024; | 15 const size_t Manifest::kMaxIPCStringLength = 4 * 1024; |
16 | 16 |
17 Manifest::Icon::Icon() { } | 17 Manifest::Icon::Icon() { } |
18 | 18 |
19 Manifest::Icon::Icon(const Icon& other) = default; | 19 Manifest::Icon::Icon(const Icon& other) = default; |
20 | 20 |
21 Manifest::Icon::~Icon() { | 21 Manifest::Icon::~Icon() { } |
22 } | |
23 | 22 |
24 bool Manifest::Icon::operator==(const Manifest::Icon& other) const { | 23 bool Manifest::Icon::operator==(const Manifest::Icon& other) const { |
25 return src == other.src && type == other.type && sizes == other.sizes; | 24 return src == other.src && type == other.type && sizes == other.sizes; |
26 } | 25 } |
27 | 26 |
28 Manifest::RelatedApplication::RelatedApplication() { | 27 Manifest::ShareTarget::ShareTarget() { } |
Matt Giuca
2017/01/18 07:51:32
Has this been git cl formatted? I think there's su
constantina
2017/01/18 23:28:09
Done. There were inconsistencies, so I made all em
| |
28 | |
29 Manifest::ShareTarget::~ShareTarget() { } | |
30 | |
31 bool Manifest::ShareTarget::is_null() const { | |
32 return url_template.is_null(); | |
29 } | 33 } |
30 | 34 |
31 Manifest::RelatedApplication::~RelatedApplication() { | 35 Manifest::RelatedApplication::RelatedApplication() { } |
32 } | 36 |
37 Manifest::RelatedApplication::~RelatedApplication() { } | |
33 | 38 |
34 Manifest::Manifest() | 39 Manifest::Manifest() |
35 : display(blink::WebDisplayModeUndefined), | 40 : display(blink::WebDisplayModeUndefined), |
36 orientation(blink::WebScreenOrientationLockDefault), | 41 orientation(blink::WebScreenOrientationLockDefault), |
37 prefer_related_applications(false), | 42 prefer_related_applications(false), |
38 theme_color(Manifest::kInvalidOrMissingColor), | 43 theme_color(Manifest::kInvalidOrMissingColor), |
39 background_color(Manifest::kInvalidOrMissingColor) { | 44 background_color(Manifest::kInvalidOrMissingColor) { |
40 } | 45 } |
41 | 46 |
42 Manifest::Manifest(const Manifest& other) = default; | 47 Manifest::Manifest(const Manifest& other) = default; |
43 | 48 |
44 Manifest::~Manifest() { | 49 Manifest::~Manifest() { } |
45 } | |
46 | 50 |
47 bool Manifest::IsEmpty() const { | 51 bool Manifest::IsEmpty() const { |
48 return name.is_null() && | 52 return name.is_null() && |
49 short_name.is_null() && | 53 short_name.is_null() && |
50 start_url.is_empty() && | 54 start_url.is_empty() && |
51 display == blink::WebDisplayModeUndefined && | 55 display == blink::WebDisplayModeUndefined && |
52 orientation == blink::WebScreenOrientationLockDefault && | 56 orientation == blink::WebScreenOrientationLockDefault && |
53 icons.empty() && | 57 icons.empty() && |
58 share_target.is_null() && | |
54 related_applications.empty() && | 59 related_applications.empty() && |
55 !prefer_related_applications && | 60 !prefer_related_applications && |
56 theme_color == Manifest::kInvalidOrMissingColor && | 61 theme_color == Manifest::kInvalidOrMissingColor && |
57 background_color == Manifest::kInvalidOrMissingColor && | 62 background_color == Manifest::kInvalidOrMissingColor && |
58 gcm_sender_id.is_null() && | 63 gcm_sender_id.is_null() && |
59 scope.is_empty(); | 64 scope.is_empty(); |
60 } | 65 } |
61 | 66 |
62 } // namespace content | 67 } // namespace content |
OLD | NEW |