| 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);
|
| + static bool Read(ui::mojom::CursorDataDataView data, ui::CursorData* out);
|
| +};
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif // SERVICES_UI_PUBLIC_INTERFACES_CURSOR_CURSOR_STRUCT_TRAITS_H_
|
|
|