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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 | 71 |
72 void LayerSelectionBound::FromProtobuf( | 72 void LayerSelectionBound::FromProtobuf( |
73 const proto::LayerSelectionBound& proto) { | 73 const proto::LayerSelectionBound& proto) { |
74 type = SelectionBoundTypeFromProtobuf(proto.type()); | 74 type = SelectionBoundTypeFromProtobuf(proto.type()); |
75 edge_top = ProtoToPoint(proto.edge_top()); | 75 edge_top = ProtoToPoint(proto.edge_top()); |
76 edge_bottom = ProtoToPoint(proto.edge_bottom()); | 76 edge_bottom = ProtoToPoint(proto.edge_bottom()); |
77 layer_id = proto.layer_id(); | 77 layer_id = proto.layer_id(); |
78 } | 78 } |
79 | 79 |
| 80 void LayerSelectionToProtobuf(const LayerSelection& selection, |
| 81 proto::LayerSelection* proto) { |
| 82 selection.start.ToProtobuf(proto->mutable_start()); |
| 83 selection.end.ToProtobuf(proto->mutable_end()); |
| 84 proto->set_is_editable(selection.is_editable); |
| 85 proto->set_is_empty_text_form_control(selection.is_empty_text_form_control); |
| 86 } |
| 87 |
| 88 void LayerSelectionFromProtobuf(LayerSelection* selection, |
| 89 const proto::LayerSelection& proto) { |
| 90 selection->start.FromProtobuf(proto.start()); |
| 91 selection->end.FromProtobuf(proto.end()); |
| 92 selection->is_editable = proto.is_editable(); |
| 93 selection->is_empty_text_form_control = proto.is_empty_text_form_control(); |
| 94 } |
| 95 |
80 } // namespace cc | 96 } // namespace cc |
OLD | NEW |