| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/display/mojo/display_struct_traits.h" | 5 #include "ui/display/mojo/display_struct_traits.h" |
| 6 | 6 |
| 7 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" | 7 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" |
| 8 | 8 |
| 9 namespace mojo { | 9 namespace mojo { |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 *out = display::Display::TOUCH_SUPPORT_UNKNOWN; | 69 *out = display::Display::TOUCH_SUPPORT_UNKNOWN; |
| 70 return true; | 70 return true; |
| 71 case display::mojom::TouchSupport::AVAILABLE: | 71 case display::mojom::TouchSupport::AVAILABLE: |
| 72 *out = display::Display::TOUCH_SUPPORT_AVAILABLE; | 72 *out = display::Display::TOUCH_SUPPORT_AVAILABLE; |
| 73 return true; | 73 return true; |
| 74 case display::mojom::TouchSupport::UNAVAILABLE: | 74 case display::mojom::TouchSupport::UNAVAILABLE: |
| 75 *out = display::Display::TOUCH_SUPPORT_UNAVAILABLE; | 75 *out = display::Display::TOUCH_SUPPORT_UNAVAILABLE; |
| 76 return true; | 76 return true; |
| 77 } | 77 } |
| 78 NOTREACHED(); | 78 NOTREACHED(); |
| 79 return display::Display::TOUCH_SUPPORT_UNKNOWN; | 79 return false; |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool StructTraits<display::mojom::DisplayDataView, display::Display>::Read( | 82 bool StructTraits<display::mojom::DisplayDataView, display::Display>::Read( |
| 83 display::mojom::DisplayDataView data, | 83 display::mojom::DisplayDataView data, |
| 84 display::Display* out) { | 84 display::Display* out) { |
| 85 out->set_id(data.id()); | 85 out->set_id(data.id()); |
| 86 | 86 |
| 87 if (!data.ReadBounds(&out->bounds_)) | 87 if (!data.ReadBounds(&out->bounds_)) |
| 88 return false; | 88 return false; |
| 89 | 89 |
| 90 if (!data.ReadWorkArea(&out->work_area_)) | 90 if (!data.ReadWorkArea(&out->work_area_)) |
| 91 return false; | 91 return false; |
| 92 | 92 |
| 93 out->set_device_scale_factor(data.device_scale_factor()); | 93 out->set_device_scale_factor(data.device_scale_factor()); |
| 94 | 94 |
| 95 if (!data.ReadRotation(&out->rotation_)) | 95 if (!data.ReadRotation(&out->rotation_)) |
| 96 return false; | 96 return false; |
| 97 | 97 |
| 98 if (!data.ReadTouchSupport(&out->touch_support_)) | 98 if (!data.ReadTouchSupport(&out->touch_support_)) |
| 99 return false; | 99 return false; |
| 100 | 100 |
| 101 if (!data.ReadMaximumCursorSize(&out->maximum_cursor_size_)) | 101 if (!data.ReadMaximumCursorSize(&out->maximum_cursor_size_)) |
| 102 return false; | 102 return false; |
| 103 | 103 |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace mojo | 107 } // namespace mojo |
| OLD | NEW |