Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: mojo/common/common_custom_types_struct_traits.h

Issue 2626093004: EnumTraits for base::i18n::TextDirection. (Closed)
Patch Set: Addressed feedback. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/common/BUILD.gn ('k') | mojo/common/common_custom_types_struct_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/common_custom_types_struct_traits.h
diff --git a/mojo/common/common_custom_types_struct_traits.h b/mojo/common/common_custom_types_struct_traits.h
index c45ab90ca2b494ba1cc2417c728357e145636d73..b20c795b96562e936573eb535e41cb3baf7c55b3 100644
--- a/mojo/common/common_custom_types_struct_traits.h
+++ b/mojo/common/common_custom_types_struct_traits.h
@@ -6,12 +6,14 @@
#define MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_H_
#include "base/files/file.h"
+#include "base/i18n/rtl.h"
#include "base/strings/utf_string_conversions.h"
#include "base/unguessable_token.h"
#include "base/version.h"
#include "mojo/common/file.mojom-shared.h"
#include "mojo/common/mojo_common_export.h"
#include "mojo/common/string16.mojom-shared.h"
+#include "mojo/common/text_direction.mojom-shared.h"
#include "mojo/common/time.mojom-shared.h"
#include "mojo/common/unguessable_token.mojom-shared.h"
#include "mojo/common/version.mojom-shared.h"
@@ -83,6 +85,14 @@ struct StructTraits<common::mojom::FileDataView, base::File> {
static bool Read(common::mojom::FileDataView data, base::File* file);
};
+template <>
+struct EnumTraits<common::mojom::TextDirection, base::i18n::TextDirection> {
+ static common::mojom::TextDirection ToMojom(
+ base::i18n::TextDirection text_direction);
+ static bool FromMojom(common::mojom::TextDirection input,
+ base::i18n::TextDirection* out);
+};
+
} // namespace mojo
#endif // MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_H_
« no previous file with comments | « mojo/common/BUILD.gn ('k') | mojo/common/common_custom_types_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698