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

Side by Side Diff: ui/ozone/common/mojo/display_mode_proxy_struct_traits.h

Issue 2636073002: Create mojom and StructTraits for ui/display/types/display_mode.cc (Closed)
Patch Set: convert mojo type to ui::DisplayMode_Params instead. Created 3 years, 11 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 2016 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_OZONE_COMMON_MOJO_DISPLAY_MODE_PROXY_STRUCT_TRAITS_H_
6 #define UI_OZONE_COMMON_MOJO_DISPLAY_MODE_PROXY_STRUCT_TRAITS_H_
7
8 #include "base/logging.h"
kylechar 2017/01/17 17:19:26 I don't think this is used.
thanhph1 2017/01/17 20:19:05 Done.
9 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
10
kylechar 2017/01/17 17:19:27 You have no #include that contains mojom::DisplayM
thanhph1 2017/01/17 20:19:05 Done.
11 namespace mojo {
12
13 template <>
14 struct StructTraits<ui::mojom::DisplayModeProxyDataView,
15 ui::DisplayMode_Params> {
16 static const gfx::Size& size(const ui::DisplayMode_Params& d) {
kylechar 2017/01/17 17:19:26 I would call the parameter |mode| or |display_mode
thanhph1 2017/01/17 20:19:05 Done.
17 return d.size;
18 }
kylechar 2017/01/17 17:19:26 Whitespace between methods.
thanhph1 2017/01/17 20:19:05 Done.
19 static bool is_interlaced(const ui::DisplayMode_Params& d) {
20 return d.is_interlaced;
21 }
22 static float refresh_rate(const ui::DisplayMode_Params& d) {
23 return d.refresh_rate;
24 }
25
26 static bool Read(ui::mojom::DisplayModeProxyDataView data,
27 ui::DisplayMode_Params* out) {
28 if (data.is_null())
kylechar 2017/01/17 17:19:27 You shouldn't need this check.
thanhph1 2017/01/17 20:19:05 Done.
29 return false;
30
31 if (!data.ReadSize(&out->size))
32 return false;
33
34 out->is_interlaced = data.is_interlaced();
35 out->refresh_rate = data.refresh_rate();
36
37 return true;
38 }
39 };
40
41 } // namespace mojo
42
43 #endif // UI_OZONE_COMMON_MOJO_DISPLAY_MODE_PROXY_STRUCT_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698