| 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 #ifndef CC_INPUT_SELECTION_H_ | 5 #ifndef CC_INPUT_SELECTION_H_ |
| 6 #define CC_INPUT_SELECTION_H_ | 6 #define CC_INPUT_SELECTION_H_ |
| 7 | 7 |
| 8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
| 9 | 9 |
| 10 namespace cc { | 10 namespace cc { |
| 11 | 11 |
| 12 template <typename BoundType> | 12 template <typename BoundType> |
| 13 struct CC_EXPORT Selection { | 13 struct CC_EXPORT Selection { |
| 14 Selection() : is_editable(false), is_empty_text_form_control(false) {} | 14 Selection() {} |
| 15 ~Selection() {} | 15 ~Selection() {} |
| 16 | 16 |
| 17 BoundType start, end; | 17 BoundType start, end; |
| 18 bool is_editable; | |
| 19 bool is_empty_text_form_control; | |
| 20 }; | 18 }; |
| 21 | 19 |
| 22 template <typename BoundType> | 20 template <typename BoundType> |
| 23 inline bool operator==(const Selection<BoundType>& lhs, | 21 inline bool operator==(const Selection<BoundType>& lhs, |
| 24 const Selection<BoundType>& rhs) { | 22 const Selection<BoundType>& rhs) { |
| 25 return lhs.start == rhs.start && lhs.end == rhs.end && | 23 return lhs.start == rhs.start && lhs.end == rhs.end; |
| 26 lhs.is_editable == rhs.is_editable && | |
| 27 lhs.is_empty_text_form_control == rhs.is_empty_text_form_control; | |
| 28 } | 24 } |
| 29 | 25 |
| 30 template <typename BoundType> | 26 template <typename BoundType> |
| 31 inline bool operator!=(const Selection<BoundType>& lhs, | 27 inline bool operator!=(const Selection<BoundType>& lhs, |
| 32 const Selection<BoundType>& rhs) { | 28 const Selection<BoundType>& rhs) { |
| 33 return !(lhs == rhs); | 29 return !(lhs == rhs); |
| 34 } | 30 } |
| 35 | 31 |
| 36 } // namespace cc | 32 } // namespace cc |
| 37 | 33 |
| 38 #endif // CC_INPUT_SELECTION_H_ | 34 #endif // CC_INPUT_SELECTION_H_ |
| OLD | NEW |