| 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 #ifndef CONTENT_PUBLIC_COMMON_MANIFEST_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_MANIFEST_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_MANIFEST_H_ | 6 #define CONTENT_PUBLIC_COMMON_MANIFEST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/optional.h" |
| 13 #include "base/strings/nullable_string16.h" | 14 #include "base/strings/nullable_string16.h" |
| 14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 15 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 16 #include "third_party/WebKit/public/platform/WebDisplayMode.h" | 17 #include "third_party/WebKit/public/platform/WebDisplayMode.h" |
| 17 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" | 18 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" |
| 18 #include "ui/gfx/geometry/size.h" | 19 #include "ui/gfx/geometry/size.h" |
| 19 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 | 23 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 51 // Empty if the parsing failed, the field was not present or empty. | 52 // Empty if the parsing failed, the field was not present or empty. |
| 52 // The special value "any" is represented by gfx::Size(0, 0). | 53 // The special value "any" is represented by gfx::Size(0, 0). |
| 53 std::vector<gfx::Size> sizes; | 54 std::vector<gfx::Size> sizes; |
| 54 | 55 |
| 55 // Empty if the field was not present or not of type "string". Defaults to | 56 // Empty if the field was not present or not of type "string". Defaults to |
| 56 // a vector with a single value, IconPurpose::ANY, for all other parsing | 57 // a vector with a single value, IconPurpose::ANY, for all other parsing |
| 57 // exceptions. | 58 // exceptions. |
| 58 std::vector<IconPurpose> purpose; | 59 std::vector<IconPurpose> purpose; |
| 59 }; | 60 }; |
| 60 | 61 |
| 62 // Structure representing how a Web Share target handles an incoming share. |
| 63 struct CONTENT_EXPORT ShareTarget { |
| 64 ShareTarget(); |
| 65 ~ShareTarget(); |
| 66 |
| 67 // The URL template that contains placeholders to be replaced with shared |
| 68 // data. Null if the parsing failed. |
| 69 base::NullableString16 url_template; |
| 70 }; |
| 71 |
| 61 // Structure representing a related application. | 72 // Structure representing a related application. |
| 62 struct CONTENT_EXPORT RelatedApplication { | 73 struct CONTENT_EXPORT RelatedApplication { |
| 63 RelatedApplication(); | 74 RelatedApplication(); |
| 64 ~RelatedApplication(); | 75 ~RelatedApplication(); |
| 65 | 76 |
| 66 // The platform on which the application can be found. This can be any | 77 // The platform on which the application can be found. This can be any |
| 67 // string, and is interpreted by the consumer of the object. Empty if the | 78 // string, and is interpreted by the consumer of the object. Empty if the |
| 68 // parsing failed. | 79 // parsing failed. |
| 69 base::NullableString16 platform; | 80 base::NullableString16 platform; |
| 70 | 81 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 100 blink::WebDisplayMode display; | 111 blink::WebDisplayMode display; |
| 101 | 112 |
| 102 // Set to blink::WebScreenOrientationLockDefault if the parsing failed or the | 113 // Set to blink::WebScreenOrientationLockDefault if the parsing failed or the |
| 103 // field was not present. | 114 // field was not present. |
| 104 blink::WebScreenOrientationLockType orientation; | 115 blink::WebScreenOrientationLockType orientation; |
| 105 | 116 |
| 106 // Empty if the parsing failed, the field was not present, empty or all the | 117 // Empty if the parsing failed, the field was not present, empty or all the |
| 107 // icons inside the JSON array were invalid. | 118 // icons inside the JSON array were invalid. |
| 108 std::vector<Icon> icons; | 119 std::vector<Icon> icons; |
| 109 | 120 |
| 121 // Null if parsing failed or the field was not present. |
| 122 // TODO(constantina): This field is non-standard and part of a Chrome |
| 123 // experiment. See: |
| 124 // https://github.com/WICG/web-share-target/blob/master/docs/interface.md |
| 125 // As such, this field should not be exposed to web contents. |
| 126 base::Optional<ShareTarget> share_target; |
| 127 |
| 110 // Empty if the parsing failed, the field was not present, empty or all the | 128 // Empty if the parsing failed, the field was not present, empty or all the |
| 111 // applications inside the array were invalid. The order of the array | 129 // applications inside the array were invalid. The order of the array |
| 112 // indicates the priority of the application to use. | 130 // indicates the priority of the application to use. |
| 113 std::vector<RelatedApplication> related_applications; | 131 std::vector<RelatedApplication> related_applications; |
| 114 | 132 |
| 115 // A boolean that is used as a hint for the user agent to say that related | 133 // A boolean that is used as a hint for the user agent to say that related |
| 116 // applications should be preferred over the web application. False if missing | 134 // applications should be preferred over the web application. False if missing |
| 117 // or there is a parsing failure. | 135 // or there is a parsing failure. |
| 118 bool prefer_related_applications; | 136 bool prefer_related_applications; |
| 119 | 137 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 145 static const size_t kMaxIPCStringLength; | 163 static const size_t kMaxIPCStringLength; |
| 146 | 164 |
| 147 // Constant representing an invalid color. Set to a value outside the | 165 // Constant representing an invalid color. Set to a value outside the |
| 148 // range of a 32-bit integer. | 166 // range of a 32-bit integer. |
| 149 static const int64_t kInvalidOrMissingColor; | 167 static const int64_t kInvalidOrMissingColor; |
| 150 }; | 168 }; |
| 151 | 169 |
| 152 } // namespace content | 170 } // namespace content |
| 153 | 171 |
| 154 #endif // CONTENT_PUBLIC_COMMON_MANIFEST_H_ | 172 #endif // CONTENT_PUBLIC_COMMON_MANIFEST_H_ |
| OLD | NEW |