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

Side by Side Diff: cc/input/layer_selection_bound.cc

Issue 1578523002: Move SelectionBoundType to inside the LayerSelectionBound message. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/proto/layer_selection_bound.proto » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 {
11 namespace { 11 namespace {
12 12
13 proto::SelectionBoundType SelectionBoundTypeToProtobuf( 13 proto::LayerSelectionBound::SelectionBoundType SelectionBoundTypeToProtobuf(
14 const SelectionBoundType& type) { 14 const SelectionBoundType& type) {
15 switch (type) { 15 switch (type) {
16 case SELECTION_BOUND_LEFT: 16 case SELECTION_BOUND_LEFT:
17 return proto::SelectionBoundType::LEFT; 17 return proto::LayerSelectionBound_SelectionBoundType_LEFT;
18 case SELECTION_BOUND_RIGHT: 18 case SELECTION_BOUND_RIGHT:
19 return proto::SelectionBoundType::RIGHT; 19 return proto::LayerSelectionBound_SelectionBoundType_RIGHT;
20 case SELECTION_BOUND_CENTER: 20 case SELECTION_BOUND_CENTER:
21 return proto::SelectionBoundType::CENTER; 21 return proto::LayerSelectionBound_SelectionBoundType_CENTER;
22 case SELECTION_BOUND_EMPTY: 22 case SELECTION_BOUND_EMPTY:
23 return proto::SelectionBoundType::EMPTY; 23 return proto::LayerSelectionBound_SelectionBoundType_EMPTY;
24 } 24 }
25 NOTREACHED() << "proto::SelectionBoundType::UNKNOWN"; 25 NOTREACHED() << "proto::LayerSelectionBound_SelectionBoundType_UNKNOWN";
26 return proto::SelectionBoundType::UNKNOWN; 26 return proto::LayerSelectionBound_SelectionBoundType_UNKNOWN;
27 } 27 }
28 28
29 SelectionBoundType SelectionBoundTypeFromProtobuf( 29 SelectionBoundType SelectionBoundTypeFromProtobuf(
30 const proto::SelectionBoundType& type) { 30 const proto::LayerSelectionBound::SelectionBoundType& type) {
31 switch (type) { 31 switch (type) {
32 case proto::SelectionBoundType::LEFT: 32 case proto::LayerSelectionBound_SelectionBoundType_LEFT:
33 return SELECTION_BOUND_LEFT; 33 return SELECTION_BOUND_LEFT;
34 case proto::SelectionBoundType::RIGHT: 34 case proto::LayerSelectionBound_SelectionBoundType_RIGHT:
35 return SELECTION_BOUND_RIGHT; 35 return SELECTION_BOUND_RIGHT;
36 case proto::SelectionBoundType::CENTER: 36 case proto::LayerSelectionBound_SelectionBoundType_CENTER:
37 return SELECTION_BOUND_CENTER; 37 return SELECTION_BOUND_CENTER;
38 case proto::SelectionBoundType::EMPTY: 38 case proto::LayerSelectionBound_SelectionBoundType_EMPTY:
39 return SELECTION_BOUND_EMPTY; 39 return SELECTION_BOUND_EMPTY;
40 case proto::SelectionBoundType::UNKNOWN: 40 case proto::LayerSelectionBound_SelectionBoundType_UNKNOWN:
41 NOTREACHED() << "proto::SelectionBoundType::UNKNOWN"; 41 NOTREACHED() << "proto::LayerSelectionBound_SelectionBoundType_UNKNOWN";
42 return SELECTION_BOUND_EMPTY; 42 return SELECTION_BOUND_EMPTY;
43 } 43 }
44 return SELECTION_BOUND_EMPTY; 44 return SELECTION_BOUND_EMPTY;
45 } 45 }
46 46
47 } // namespace 47 } // namespace
48 48
49 LayerSelectionBound::LayerSelectionBound() 49 LayerSelectionBound::LayerSelectionBound()
50 : type(SELECTION_BOUND_EMPTY), layer_id(0) { 50 : type(SELECTION_BOUND_EMPTY), layer_id(0) {
51 } 51 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 void LayerSelectionFromProtobuf(LayerSelection* selection, 88 void LayerSelectionFromProtobuf(LayerSelection* selection,
89 const proto::LayerSelection& proto) { 89 const proto::LayerSelection& proto) {
90 selection->start.FromProtobuf(proto.start()); 90 selection->start.FromProtobuf(proto.start());
91 selection->end.FromProtobuf(proto.end()); 91 selection->end.FromProtobuf(proto.end());
92 selection->is_editable = proto.is_editable(); 92 selection->is_editable = proto.is_editable();
93 selection->is_empty_text_form_control = proto.is_empty_text_form_control(); 93 selection->is_empty_text_form_control = proto.is_empty_text_form_control();
94 } 94 }
95 95
96 } // namespace cc 96 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/proto/layer_selection_bound.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698