| 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 "base/strings/nullable_string16.h" | 8 #include "base/strings/nullable_string16.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 // The Manifest structure is an internal representation of the Manifest file | 14 // The Manifest structure is an internal representation of the Manifest file |
| 15 // described in the "Manifest for Web Application" document: | 15 // described in the "Manifest for Web Application" document: |
| 16 // http://w3c.github.io/manifest/ | 16 // http://w3c.github.io/manifest/ |
| 17 struct CONTENT_EXPORT Manifest { | 17 struct CONTENT_EXPORT Manifest { |
| 18 enum DisplayMode { |
| 19 DISPLAY_MODE_UNSPECIFIED, |
| 20 DISPLAY_MODE_FULLSCREEN, |
| 21 DISPLAY_MODE_STANDALONE, |
| 22 DISPLAY_MODE_MINIMAL_UI, |
| 23 DISPLAY_MODE_BROWSER |
| 24 }; |
| 25 |
| 18 Manifest(); | 26 Manifest(); |
| 19 ~Manifest(); | 27 ~Manifest(); |
| 20 | 28 |
| 21 // Returns whether this Manifest had no attribute set. A newly created | 29 // Returns whether this Manifest had no attribute set. A newly created |
| 22 // Manifest is always empty. | 30 // Manifest is always empty. |
| 23 bool IsEmpty() const; | 31 bool IsEmpty() const; |
| 24 | 32 |
| 25 // Null if the parsing failed or the field was not present. | 33 // Null if the parsing failed or the field was not present. |
| 26 base::NullableString16 name; | 34 base::NullableString16 name; |
| 27 | 35 |
| 28 // Null if the parsing failed or the field was not present. | 36 // Null if the parsing failed or the field was not present. |
| 29 base::NullableString16 short_name; | 37 base::NullableString16 short_name; |
| 30 | 38 |
| 31 // Empty if the parsing failed or the field was not present. | 39 // Empty if the parsing failed or the field was not present. |
| 32 GURL start_url; | 40 GURL start_url; |
| 33 | 41 |
| 42 // Set to DISPLAY_MODE_UNSPECIFIED if the parsing failed or the field was not |
| 43 // present. |
| 44 DisplayMode display; |
| 45 |
| 34 // Maximum length for all the strings inside the Manifest when it is sent over | 46 // Maximum length for all the strings inside the Manifest when it is sent over |
| 35 // IPC. The renderer process should truncate the strings before sending the | 47 // IPC. The renderer process should truncate the strings before sending the |
| 36 // Manifest and the browser process must do the same when receiving it. | 48 // Manifest and the browser process must do the same when receiving it. |
| 37 static const size_t kMaxIPCStringLength; | 49 static const size_t kMaxIPCStringLength; |
| 38 }; | 50 }; |
| 39 | 51 |
| 40 } // namespace content | 52 } // namespace content |
| 41 | 53 |
| 42 #endif // CONTENT_PUBLIC_COMMON_MANIFEST_H_ | 54 #endif // CONTENT_PUBLIC_COMMON_MANIFEST_H_ |
| OLD | NEW |