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

Unified Diff: services/ui/public/interfaces/cursor/cursor_struct_traits.h

Issue 2786983003: [aura-mus] Add ui::CursorData, with mojo serialization. (Closed)
Patch Set: Created 3 years, 9 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
Index: services/ui/public/interfaces/cursor/cursor_struct_traits.h
diff --git a/services/ui/public/interfaces/cursor/cursor_struct_traits.h b/services/ui/public/interfaces/cursor/cursor_struct_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..c236a351e0b4e71cc10e516e2dae539cd1e95c63
--- /dev/null
+++ b/services/ui/public/interfaces/cursor/cursor_struct_traits.h
@@ -0,0 +1,28 @@
+// Copyright 2017 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 SERVICES_UI_PUBLIC_INTERFACES_CURSOR_CURSOR_STRUCT_TRAITS_H_
+#define SERVICES_UI_PUBLIC_INTERFACES_CURSOR_CURSOR_STRUCT_TRAITS_H_
+
+#include "services/ui/public/interfaces/cursor/cursor.mojom-shared.h"
+#include "ui/base/cursor/cursor_data.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<ui::mojom::CursorDataDataView, ui::CursorData> {
+ static ui::mojom::CursorType native_type(const ui::CursorData& c) {
+ return ui::mojom::CursorType(c.native_type());
+ }
+ static uint32_t frame_delay_ms(const ui::CursorData& c) {
+ return c.frame_delay_ms();
+ }
+ static gfx::Point hotspot(const ui::CursorData& c) { return c.hotspot(); }
+ static const std::vector<SkBitmap>& cursor_frames(const ui::CursorData& c);
Elliot Glaysher 2017/03/30 22:53:33 A fun learning experience: this compiles if I retu
+ static bool Read(ui::mojom::CursorDataDataView data, ui::CursorData* out);
+};
+
+} // namespace mojo
+
+#endif // SERVICES_UI_PUBLIC_INTERFACES_CURSOR_CURSOR_STRUCT_TRAITS_H_
« no previous file with comments | « services/ui/public/interfaces/cursor/cursor.typemap ('k') | services/ui/public/interfaces/cursor/cursor_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698