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

Unified Diff: chrome/browser/renderer_host/gtk_im_context_wrapper.h

Issue 6709023: Move some common ime code to ui/base/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Always put the composition cursor to the selection end. Created 9 years, 9 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 | « no previous file | chrome/browser/renderer_host/gtk_im_context_wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/gtk_im_context_wrapper.h
diff --git a/chrome/browser/renderer_host/gtk_im_context_wrapper.h b/chrome/browser/renderer_host/gtk_im_context_wrapper.h
index 60bff99847fc5eb5144db1fcd753b6f1f33f8134..f41b7c199a6522975555f45fd1acb632f9621dc1 100644
--- a/chrome/browser/renderer_host/gtk_im_context_wrapper.h
+++ b/chrome/browser/renderer_host/gtk_im_context_wrapper.h
@@ -13,9 +13,9 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/string16.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputType.h"
+#include "ui/base/ime/composition_text.h"
namespace gfx {
class Rect;
@@ -64,10 +64,6 @@ class GtkIMContextWrapper {
void ConfirmComposition();
private:
- // For unit tests.
- class GtkIMContextWrapperTest;
- FRIEND_TEST_ALL_PREFIXES(GtkIMContextWrapperTest, ExtractCompositionInfo);
-
// Check if a text needs commit by forwarding a char event instead of
// by confirming as a composition text.
bool NeedCommitByForwardingCharEvent() const;
@@ -124,17 +120,6 @@ class GtkIMContextWrapper {
static void HandleHostViewUnrealizeThunk(GtkWidget* widget,
GtkIMContextWrapper* self);
- // Extracts composition underlines, selection range and utf-16 text from given
- // utf-8 text, pango attributes and cursor position.
- static void ExtractCompositionInfo(
- const gchar* utf8_text,
- PangoAttrList* attrs,
- int cursor_position,
- string16* utf16_text,
- std::vector<WebKit::WebCompositionUnderline>* underlines,
- int* selection_start,
- int* selection_end);
-
// The parent object.
RenderWidgetHostViewGtk* host_view_;
@@ -186,19 +171,11 @@ class GtkIMContextWrapper {
// key event handler will send them later.
bool is_in_key_event_handler_;
- // Stores a copy of the most recent preedit text retrieved from context_.
- string16 preedit_text_;
-
- // Stores the selection range in the stored preedit text.
- int preedit_selection_start_;
- int preedit_selection_end_;
-
- // Stores composition underlines computed from the pango attributes of the
- // most recent preedit text.
- std::vector<WebKit::WebCompositionUnderline> preedit_underlines_;
+ // The most recent composition text information retrieved from context_;
+ ui::CompositionText composition_;
- // Whether or not the preedit has been changed since last key event.
- bool is_preedit_changed_;
+ // Whether or not the composition has been changed since last key event.
+ bool is_composition_changed_;
// Stores a copy of the most recent commit text received by commit signal
// handler.
« no previous file with comments | « no previous file | chrome/browser/renderer_host/gtk_im_context_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698