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

Side by Side Diff: chromeos/dbus/ibus/ibus_lookup_table.cc

Issue 24946003: Rename IBusLookupTable to CandidateWindow, and move it to chromeos/ime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 7 years, 2 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 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.
4
5 #include "chromeos/dbus/ibus/ibus_lookup_table.h"
6
7 #include <string>
8 #include "base/logging.h"
9 #include "base/values.h"
10
11 namespace chromeos {
12
13 namespace {
14 // The default entry number of a page in IBusLookupTable.
15 const int kDefaultPageSize = 9;
16 } // namespace
17
18 ///////////////////////////////////////////////////////////////////////////////
19 // IBusLookupTable
20 IBusLookupTable::IBusLookupTable()
21 : property_(new CandidateWindowProperty) {
22 }
23
24 IBusLookupTable::~IBusLookupTable() {
25 }
26
27 bool IBusLookupTable::IsEqual(const IBusLookupTable& table) const {
28 if (page_size() != table.page_size() ||
29 cursor_position() != table.cursor_position() ||
30 is_cursor_visible() != table.is_cursor_visible() ||
31 orientation() != table.orientation() ||
32 show_window_at_composition() != table.show_window_at_composition() ||
33 candidates_.size() != table.candidates_.size())
34 return false;
35
36 for (size_t i = 0; i < candidates_.size(); ++i) {
37 const Entry& left = candidates_[i];
38 const Entry& right = table.candidates_[i];
39 if (left.value != right.value ||
40 left.label != right.label ||
41 left.annotation != right.annotation ||
42 left.description_title != right.description_title ||
43 left.description_body != right.description_body)
44 return false;
45 }
46 return true;
47 }
48
49 void IBusLookupTable::CopyFrom(const IBusLookupTable& table) {
50 SetProperty(table.GetProperty());
51 candidates_.clear();
52 candidates_ = table.candidates_;
53 }
54
55
56 // When the default values are changed, please modify
57 // InputMethodEngine::CandidateWindowProperty too.
58 IBusLookupTable::CandidateWindowProperty::CandidateWindowProperty()
59 : page_size(kDefaultPageSize),
60 cursor_position(0),
61 is_cursor_visible(true),
62 is_vertical(false),
63 show_window_at_composition(false) {
64 }
65
66 IBusLookupTable::CandidateWindowProperty::~CandidateWindowProperty() {
67 }
68
69 IBusLookupTable::Entry::Entry() {
70 }
71
72 IBusLookupTable::Entry::~Entry() {
73 }
74
75 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/ibus/ibus_lookup_table.h ('k') | chromeos/dbus/ibus/ibus_lookup_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698