| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "cc/input/layer_selection_bound.h" | 6 #include "cc/input/layer_selection_bound.h" |
| 7 #include "cc/proto/gfx_conversions.h" | 7 #include "cc/proto/gfx_conversions.h" |
| 8 #include "cc/proto/layer_selection_bound.pb.h" | 8 #include "cc/proto/layer_selection_bound.pb.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 const LayerSelectionBound& rhs) { | 72 const LayerSelectionBound& rhs) { |
| 73 return lhs.type == rhs.type && lhs.layer_id == rhs.layer_id && | 73 return lhs.type == rhs.type && lhs.layer_id == rhs.layer_id && |
| 74 lhs.edge_top == rhs.edge_top && lhs.edge_bottom == rhs.edge_bottom; | 74 lhs.edge_top == rhs.edge_top && lhs.edge_bottom == rhs.edge_bottom; |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool operator!=(const LayerSelectionBound& lhs, | 77 bool operator!=(const LayerSelectionBound& lhs, |
| 78 const LayerSelectionBound& rhs) { | 78 const LayerSelectionBound& rhs) { |
| 79 return !(lhs == rhs); | 79 return !(lhs == rhs); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void LayerSelectionToProtobuf(const LayerSelection& selection, |
| 83 proto::LayerSelection* proto) { |
| 84 selection.start.ToProtobuf(proto->mutable_start()); |
| 85 selection.end.ToProtobuf(proto->mutable_end()); |
| 86 proto->set_is_editable(selection.is_editable); |
| 87 proto->set_is_empty_text_form_control(selection.is_empty_text_form_control); |
| 88 } |
| 89 |
| 90 void LayerSelectionFromProtobuf(LayerSelection* selection, |
| 91 const proto::LayerSelection& proto) { |
| 92 selection->start.FromProtobuf(proto.start()); |
| 93 selection->end.FromProtobuf(proto.end()); |
| 94 selection->is_editable = proto.is_editable(); |
| 95 selection->is_empty_text_form_control = proto.is_empty_text_form_control(); |
| 96 } |
| 97 |
| 82 } // namespace cc | 98 } // namespace cc |
| OLD | NEW |