| 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 "components/arc/common/app_struct_traits.h" | 5 #include "components/arc/common/app_struct_traits.h" |
| 6 | 6 |
| 7 namespace mojo { | 7 namespace mojo { |
| 8 | 8 |
| 9 bool StructTraits<arc::mojom::ScreenRect, gfx::Rect>::Read( | 9 bool StructTraits<arc::mojom::ScreenRectDataView, gfx::Rect>::Read( |
| 10 arc::mojom::ScreenRectDataView data, gfx::Rect* out) { | 10 arc::mojom::ScreenRectDataView data, |
| 11 gfx::Rect* out) { |
| 11 if (data.right() < data.left() || data.bottom() < data.top()) | 12 if (data.right() < data.left() || data.bottom() < data.top()) |
| 12 return false; | 13 return false; |
| 13 | 14 |
| 14 out->SetRect(data.left(), data.top(), data.right() - data.left(), | 15 out->SetRect(data.left(), data.top(), data.right() - data.left(), |
| 15 data.bottom() - data.top()); | 16 data.bottom() - data.top()); |
| 16 return true; | 17 return true; |
| 17 } | 18 } |
| 18 | 19 |
| 19 } // namespace mojo | 20 } // namespace mojo |
| OLD | NEW |