Chromium Code Reviews| Index: content/common/manifest_type_converters.h |
| diff --git a/content/common/manifest_type_converters.h b/content/common/manifest_type_converters.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ddcea3ba96d03531e5cbde9bea6880ddd273c2d1 |
| --- /dev/null |
| +++ b/content/common/manifest_type_converters.h |
| @@ -0,0 +1,64 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_COMMON_MANIFEST_TYPE_CONVERTERS_H_ |
| +#define CONTENT_COMMON_MANIFEST_TYPE_CONVERTERS_H_ |
| + |
| +#include <stddef.h> |
| + |
| +#include "base/strings/nullable_string16.h" |
| +#include "content/public/common/manifest.h" |
| +#include "third_party/WebKit/public/platform/modules/manifest/manifest.mojom.h" |
| + |
| +namespace mojo { |
| + |
| +template <> |
| +struct TypeConverter<mojo::String, base::NullableString16> { |
| + static mojo::String Convert(const base::NullableString16& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<base::NullableString16, mojo::String> { |
| + static base::NullableString16 Convert(mojo::String input); |
| +}; |
|
mlamouri (slow - plz ping)
2016/04/27 13:38:08
Should these be in a string_type_coverters.h? or b
Sam McNally
2016/04/28 08:25:27
Done.
|
| + |
| +template <> |
| +struct TypeConverter<blink::mojom::ManifestPtr, content::Manifest> { |
| + static blink::mojom::ManifestPtr Convert(const content::Manifest& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<content::Manifest, blink::mojom::ManifestPtr> { |
| + static content::Manifest Convert(const blink::mojom::ManifestPtr& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<blink::mojom::ManifestIconPtr, content::Manifest::Icon> { |
| + static blink::mojom::ManifestIconPtr Convert( |
| + const content::Manifest::Icon& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<content::Manifest::Icon, blink::mojom::ManifestIconPtr> { |
| + static content::Manifest::Icon Convert( |
| + const blink::mojom::ManifestIconPtr& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<blink::mojom::RelatedApplicationPtr, |
| + content::Manifest::RelatedApplication> { |
| + static blink::mojom::RelatedApplicationPtr Convert( |
| + const content::Manifest::RelatedApplication& input); |
| +}; |
| + |
| +template <> |
| +struct TypeConverter<content::Manifest::RelatedApplication, |
| + blink::mojom::RelatedApplicationPtr> { |
| + static content::Manifest::RelatedApplication Convert( |
| + const blink::mojom::RelatedApplicationPtr& input); |
| +}; |
| + |
| +} // namespace mojo |
| + |
| +#endif // CONTENT_COMMON_MANIFEST_TYPE_CONVERTERS_H_ |