| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/nullable_string16.h" | 10 #include "base/strings/nullable_string16.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" | 12 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" |
| 13 #include "ui/gfx/geometry/size.h" |
| 13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 // The Manifest structure is an internal representation of the Manifest file | 18 // The Manifest structure is an internal representation of the Manifest file |
| 18 // described in the "Manifest for Web Application" document: | 19 // described in the "Manifest for Web Application" document: |
| 19 // http://w3c.github.io/manifest/ | 20 // http://w3c.github.io/manifest/ |
| 20 struct CONTENT_EXPORT Manifest { | 21 struct CONTENT_EXPORT Manifest { |
| 21 enum DisplayMode { | 22 enum DisplayMode { |
| 22 DISPLAY_MODE_UNSPECIFIED, | 23 DISPLAY_MODE_UNSPECIFIED, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 38 | 39 |
| 39 // Null if the parsing failed or the field was not present. The type can be | 40 // Null if the parsing failed or the field was not present. The type can be |
| 40 // any string and doesn't have to be a valid image MIME type at this point. | 41 // any string and doesn't have to be a valid image MIME type at this point. |
| 41 // It is up to the consumer of the object to check if the type matches a | 42 // It is up to the consumer of the object to check if the type matches a |
| 42 // supported type. | 43 // supported type. |
| 43 base::NullableString16 type; | 44 base::NullableString16 type; |
| 44 | 45 |
| 45 // Default value is 1.0 if the value is missing or invalid. | 46 // Default value is 1.0 if the value is missing or invalid. |
| 46 double density; | 47 double density; |
| 47 | 48 |
| 49 // Empty if the parsing failed, the field was not present or empty. |
| 50 // The special value "any" is represented by gfx::Size(0, 0). |
| 51 std::vector<gfx::Size> sizes; |
| 52 |
| 48 // Default density. Set to 1.0. | 53 // Default density. Set to 1.0. |
| 49 static const double kDefaultDensity; | 54 static const double kDefaultDensity; |
| 50 }; | 55 }; |
| 51 | 56 |
| 52 Manifest(); | 57 Manifest(); |
| 53 ~Manifest(); | 58 ~Manifest(); |
| 54 | 59 |
| 55 // Returns whether this Manifest had no attribute set. A newly created | 60 // Returns whether this Manifest had no attribute set. A newly created |
| 56 // Manifest is always empty. | 61 // Manifest is always empty. |
| 57 bool IsEmpty() const; | 62 bool IsEmpty() const; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 79 | 84 |
| 80 // Maximum length for all the strings inside the Manifest when it is sent over | 85 // Maximum length for all the strings inside the Manifest when it is sent over |
| 81 // IPC. The renderer process should truncate the strings before sending the | 86 // IPC. The renderer process should truncate the strings before sending the |
| 82 // Manifest and the browser process must do the same when receiving it. | 87 // Manifest and the browser process must do the same when receiving it. |
| 83 static const size_t kMaxIPCStringLength; | 88 static const size_t kMaxIPCStringLength; |
| 84 }; | 89 }; |
| 85 | 90 |
| 86 } // namespace content | 91 } // namespace content |
| 87 | 92 |
| 88 #endif // CONTENT_PUBLIC_COMMON_MANIFEST_H_ | 93 #endif // CONTENT_PUBLIC_COMMON_MANIFEST_H_ |
| OLD | NEW |