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

Side by Side Diff: ui/display/mojo/display_mode_struct_traits.cc

Issue 2646213002: Write mojom and StructTraits for DisplaySnapshot. (Closed)
Patch Set: use FILE_PATH_LITERAL to create base::FilePath::StringType Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_CC_
kylechar 2017/02/09 15:05:53 Again, remove this.
thanhph1 2017/02/10 19:54:32 Done.
6 #define UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_CC_
7
8 #include "ui/display/mojo/display_mode_struct_traits.h"
kylechar 2017/02/09 15:05:53 Please read the style guide section on includes an
thanhph1 2017/02/10 19:54:31 I removed a duplicated include size.h
9 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h"
10 #include "ui/gfx/geometry/size.h"
11
12 namespace mojo {
13
14 // static
15 bool StructTraits<display::mojom::DisplayModeDataView,
16 std::unique_ptr<display::DisplayMode>>::
17 Read(display::mojom::DisplayModeDataView data,
18 std::unique_ptr<display::DisplayMode>* out) {
19 gfx::Size size;
20 if (!data.ReadSize(&size))
21 return false;
22 *out = base::MakeUnique<display::DisplayMode>(size, data.is_interlaced(),
23 data.refresh_rate());
24 return true;
25 };
26
27 } // namespace mojo
28
29 #endif // UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_CC_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698