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

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

Issue 10828114: Fix missing default values. (Closed) Base URL: http://git.chromium.org/chromium/src.git@ibus_module_revise
Patch Set: Add default value for initial page size constant Created 8 years, 4 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 | chromeos/dbus/ibus/ibus_property.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 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 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 "chromeos/dbus/ibus/ibus_lookup_table.h" 5 #include "chromeos/dbus/ibus/ibus_lookup_table.h"
6 6
7 #include <string> 7 #include <string>
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "dbus/message.h" 9 #include "dbus/message.h"
10 #include "chromeos/dbus/ibus/ibus_text.h" 10 #include "chromeos/dbus/ibus/ibus_text.h"
11 #include "chromeos/dbus/ibus/ibus_object.h" 11 #include "chromeos/dbus/ibus/ibus_object.h"
12 12
13 namespace chromeos { 13 namespace chromeos {
14 // TODO(nona): Remove ibus namespace after complete libibus removal. 14 // TODO(nona): Remove ibus namespace after complete libibus removal.
15 namespace ibus { 15 namespace ibus {
16 16
17 namespace {
18 // The default entry number of a page in IBusLookupTable.
19 const int kDefaultPageSize = 9;
20 } // namespace
21
17 void AppendIBusLookupTable(const IBusLookupTable& table, 22 void AppendIBusLookupTable(const IBusLookupTable& table,
18 dbus::MessageWriter* writer) { 23 dbus::MessageWriter* writer) {
19 IBusObjectWriter ibus_lookup_table_writer("IBusLookupTable", 24 IBusObjectWriter ibus_lookup_table_writer("IBusLookupTable",
20 "uubbiavav", 25 "uubbiavav",
21 writer); 26 writer);
22 ibus_lookup_table_writer.AppendUint32(table.page_size()); 27 ibus_lookup_table_writer.AppendUint32(table.page_size());
23 ibus_lookup_table_writer.AppendUint32(table.cursor_position()); 28 ibus_lookup_table_writer.AppendUint32(table.cursor_position());
24 ibus_lookup_table_writer.AppendBool(table.is_cursor_visible()); 29 ibus_lookup_table_writer.AppendBool(table.is_cursor_visible());
25 ibus_lookup_table_writer.AppendBool(false); // Not used in Chrome. 30 ibus_lookup_table_writer.AppendBool(false); // Not used in Chrome.
26 ibus_lookup_table_writer.AppendInt32(static_cast<int32>(table.orientation())); 31 ibus_lookup_table_writer.AppendInt32(static_cast<int32>(table.orientation()));
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 return false; 195 return false;
191 } 196 }
192 (*candidates)[i].label = label_text; 197 (*candidates)[i].label = label_text;
193 } 198 }
194 return true; 199 return true;
195 } 200 }
196 201
197 /////////////////////////////////////////////////////////////////////////////// 202 ///////////////////////////////////////////////////////////////////////////////
198 // IBusLookupTable 203 // IBusLookupTable
199 IBusLookupTable::IBusLookupTable() 204 IBusLookupTable::IBusLookupTable()
200 : page_size_(0), 205 : page_size_(kDefaultPageSize),
201 cursor_position_(0), 206 cursor_position_(0),
202 is_cursor_visible_(true), 207 is_cursor_visible_(true),
203 orientation_(IBUS_LOOKUP_TABLE_ORIENTATION_HORIZONTAL) { 208 orientation_(IBUS_LOOKUP_TABLE_ORIENTATION_HORIZONTAL) {
204 } 209 }
205 210
206 IBusLookupTable::~IBusLookupTable() { 211 IBusLookupTable::~IBusLookupTable() {
207 } 212 }
208 213
209 } // namespace ibus 214 } // namespace ibus
210 } // namespace chromeos 215 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/dbus/ibus/ibus_property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698