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

Unified Diff: ui/display/mojo/display_mode_struct_traits.cc

Issue 2646213002: Write mojom and StructTraits for DisplaySnapshot. (Closed)
Patch Set: Rebase. 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
« no previous file with comments | « ui/display/mojo/display_mode_struct_traits.h ('k') | ui/display/mojo/display_snapshot_mojo.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/display/mojo/display_mode_struct_traits.h ('k') | ui/display/mojo/display_snapshot_mojo.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698