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

Unified Diff: chromeos/ime/candidate_window.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/ibus/ibus_lookup_table_unittest.cc ('k') | chromeos/ime/candidate_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/ime/candidate_window.h
diff --git a/chromeos/dbus/ibus/ibus_lookup_table.h b/chromeos/ime/candidate_window.h
similarity index 54%
rename from chromeos/dbus/ibus/ibus_lookup_table.h
rename to chromeos/ime/candidate_window.h
index bb6780e3f8396cbc864f2a6abbd5900d1cf50589..12b9e9e3faa0ed235bfb456747e3c848682c65d8 100644
--- a/chromeos/dbus/ibus/ibus_lookup_table.h
+++ b/chromeos/ime/candidate_window.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROMEOS_DBUS_IBUS_IBUS_LOOKUP_TABLE_H_
-#define CHROMEOS_DBUS_IBUS_IBUS_LOOKUP_TABLE_H_
+#ifndef CHROMEOS_IME_CANDIDATE_WINDOW_H_
+#define CHROMEOS_IME_CANDIDATE_WINDOW_H_
#include <string>
#include <vector>
@@ -12,58 +12,10 @@
#include "chromeos/chromeos_export.h"
namespace chromeos {
+namespace input_method {
-// The IBusLookupTable is one of IBusObjects. IBusLookupTable contains IBusTexts
-// but all of them are used as plain string. The overview of each data
-// structure is as follows:
-//
-// DATA STRUCTURE OVERVIEW:
-// variant struct {
-// string "IBusLookupTable"
-// array [
-// dict_entry (
-// string "window_show_at_composition"
-// variant variant boolean false
-// ]
-// )
-// ]
-// uint32 9 // Page size
-// uint32 1 // Cursor position
-// boolean true // Cursor visibility.
-// boolean true // Round lookup table or not. Not used in Chrome.
-// int32 1 // Orientation
-// array [ // Array of candidate text.
-// variant struct {
-// string "IBusText"
-// array []
-// string "Candidate Text"
-// variant struct {
-// string "IBusAttrList"
-// array []
-// array []
-// }
-// }
-// ... more IBusTexts
-// ]
-// array [ // Array of label text
-// variant struct {
-// string "IBusText"
-// array []
-// string "1"
-// variant struct {
-// string "IBusAttrList"
-// array []
-// array []
-// }
-// }
-// ... more IBusTexts
-// ]
-// }
-// TODO(nona): Clean up the structure.(crbug.com/129403)
-
-// An representation of IBusLookupTable object which is used in dbus
-// communication with ibus-daemon.
-class CHROMEOS_EXPORT IBusLookupTable {
+// CandidateWindow represents the structure of candidates generated from IME.
+class CHROMEOS_EXPORT CandidateWindow {
public:
enum Orientation {
HORIZONTAL = 0,
@@ -80,9 +32,7 @@ class CHROMEOS_EXPORT IBusLookupTable {
bool show_window_at_composition;
};
- // Represents a candidate entry. In dbus communication, each
- // field is represented as IBusText, but attributes are not used in Chrome.
- // So just simple string is sufficient in this case.
+ // Represents a candidate entry.
struct Entry {
Entry();
virtual ~Entry();
@@ -93,14 +43,14 @@ class CHROMEOS_EXPORT IBusLookupTable {
std::string description_body;
};
- IBusLookupTable();
- virtual ~IBusLookupTable();
+ CandidateWindow();
+ virtual ~CandidateWindow();
- // Returns true if the given |table| is equal to myself.
- bool IsEqual(const IBusLookupTable& table) const;
+ // Returns true if the given |candidate_window| is equal to myself.
+ bool IsEqual(const CandidateWindow& candidate_window) const;
- // Copies |table| to myself.
- void CopyFrom(const IBusLookupTable& table);
+ // Copies |candidate_window| to myself.
+ void CopyFrom(const CandidateWindow& candidate_window);
const CandidateWindowProperty& GetProperty() const {
return *property_;
@@ -125,7 +75,7 @@ class CHROMEOS_EXPORT IBusLookupTable {
property_->is_cursor_visible = is_cursor_visible;
}
- // Returns the orientation of lookup table.
+ // Returns the orientation of the candidate window.
Orientation orientation() const {
return property_->is_vertical ? VERTICAL : HORIZONTAL;
}
@@ -147,9 +97,10 @@ class CHROMEOS_EXPORT IBusLookupTable {
scoped_ptr<CandidateWindowProperty> property_;
std::vector<Entry> candidates_;
- DISALLOW_COPY_AND_ASSIGN(IBusLookupTable);
+ DISALLOW_COPY_AND_ASSIGN(CandidateWindow);
};
+} // namespace input_method
} // namespace chromeos
-#endif // CHROMEOS_DBUS_IBUS_IBUS_LOOKUP_TABLE_H_
+#endif // CHROMEOS_IME_CANDIDATE_WINDOW_H_
« no previous file with comments | « chromeos/dbus/ibus/ibus_lookup_table_unittest.cc ('k') | chromeos/ime/candidate_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698