Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / cc / input / selection.h
blob1f3c6ebac052e0fed32d44a1b2edb3ecc489423e
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
3 // found in the LICENSE file.
5 #ifndef CC_INPUT_SELECTION_H_
6 #define CC_INPUT_SELECTION_H_
8 #include "cc/base/cc_export.h"
10 namespace cc {
12 template <typename BoundType>
13 struct CC_EXPORT Selection {
14 Selection() : is_editable(false), is_empty_text_form_control(false) {}
15 ~Selection() {}
17 BoundType start, end;
18 bool is_editable;
19 bool is_empty_text_form_control;
22 template <typename BoundType>
23 inline bool operator==(const Selection<BoundType>& lhs,
24 const Selection<BoundType>& rhs) {
25 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;
30 template <typename BoundType>
31 inline bool operator!=(const Selection<BoundType>& lhs,
32 const Selection<BoundType>& rhs) {
33 return !(lhs == rhs);
36 } // namespace cc
38 #endif // CC_INPUT_SELECTION_H_