Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / platform_window / text_input_state.cc
blobce6db8418578559b2e89e8a826fa992a4b864708
1 // Copyright 2015 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 #include "ui/platform_window/text_input_state.h"
7 namespace ui {
9 TextInputState::TextInputState()
10 : type(TEXT_INPUT_TYPE_NONE),
11 flags(TEXT_INPUT_FLAG_NONE),
12 selection_start(0),
13 selection_end(0),
14 composition_start(0),
15 composition_end(0),
16 can_compose_inline(false) {}
18 TextInputState::TextInputState(TextInputType type,
19 int flags,
20 const std::string& text,
21 int selection_start,
22 int selection_end,
23 int composition_start,
24 int composition_end,
25 bool can_compose_inline)
26 : type(type),
27 flags(flags),
28 text(text),
29 selection_start(selection_start),
30 selection_end(selection_end),
31 composition_start(composition_start),
32 composition_end(composition_end),
33 can_compose_inline(can_compose_inline) {}
35 bool TextInputState::operator==(const TextInputState& other) const {
36 return type == other.type &&
37 flags == other.flags &&
38 text == other.text &&
39 selection_start == other.selection_start &&
40 selection_end == other.selection_end &&
41 composition_start == other.composition_start &&
42 composition_end == other.composition_end &&
43 can_compose_inline == other.can_compose_inline;
46 } // namespace ui