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

Unified Diff: cc/input/layer_selection_bound.cc

Issue 1531413002: Add support for (de)serializing LayerSelection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@serialize-layer-selection-bound
Patch Set: Addressed nits from vmpstr Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/input/layer_selection_bound.h ('k') | cc/input/layer_selection_bound_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/layer_selection_bound.cc
diff --git a/cc/input/layer_selection_bound.cc b/cc/input/layer_selection_bound.cc
index 7abd9e000030aaf403063634d1ae0ef4985a8c89..a5146dcbbaa9487c08de378e31f1245fc6bf631a 100644
--- a/cc/input/layer_selection_bound.cc
+++ b/cc/input/layer_selection_bound.cc
@@ -77,4 +77,20 @@ void LayerSelectionBound::FromProtobuf(
layer_id = proto.layer_id();
}
+void LayerSelectionToProtobuf(const LayerSelection& selection,
+ proto::LayerSelection* proto) {
+ selection.start.ToProtobuf(proto->mutable_start());
+ selection.end.ToProtobuf(proto->mutable_end());
+ proto->set_is_editable(selection.is_editable);
+ proto->set_is_empty_text_form_control(selection.is_empty_text_form_control);
+}
+
+void LayerSelectionFromProtobuf(LayerSelection* selection,
+ const proto::LayerSelection& proto) {
+ selection->start.FromProtobuf(proto.start());
+ selection->end.FromProtobuf(proto.end());
+ selection->is_editable = proto.is_editable();
+ selection->is_empty_text_form_control = proto.is_empty_text_form_control();
+}
+
} // namespace cc
« no previous file with comments | « cc/input/layer_selection_bound.h ('k') | cc/input/layer_selection_bound_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698