| Index: ui/display/mojo/display_mode_struct_traits.cc
|
| diff --git a/ui/display/mojo/display_mode_struct_traits.cc b/ui/display/mojo/display_mode_struct_traits.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2c5d791032689b6085dbb1ccc9567e432c31803d
|
| --- /dev/null
|
| +++ b/ui/display/mojo/display_mode_struct_traits.cc
|
| @@ -0,0 +1,24 @@
|
| +// 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.
|
| +
|
| +#include "ui/display/mojo/display_mode_struct_traits.h"
|
| +
|
| +#include "ui/gfx/geometry/mojo/geometry_struct_traits.h"
|
| +
|
| +namespace mojo {
|
| +
|
| +// static
|
| +bool StructTraits<display::mojom::DisplayModeDataView,
|
| + std::unique_ptr<display::DisplayMode>>::
|
| + Read(display::mojom::DisplayModeDataView data,
|
| + std::unique_ptr<display::DisplayMode>* out) {
|
| + gfx::Size size;
|
| + if (!data.ReadSize(&size))
|
| + return false;
|
| + *out = base::MakeUnique<display::DisplayMode>(size, data.is_interlaced(),
|
| + data.refresh_rate());
|
| + return true;
|
| +};
|
| +
|
| +} // namespace mojo
|
|
|