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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.h

Issue 8576005: IME (input method editor) support for Aura, part 3 of 3: Use ui::InputMethod in ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: aura_win fix Created 9 years, 1 month 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
Index: content/browser/renderer_host/render_widget_host_view_aura.h
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index 0e4a5299a0d42fc8e9cf81c7a487a76d7b5c910a..1608318b520529bbf04d7c5fe80ab50af05ca2b3 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -11,9 +11,14 @@
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/common/content_export.h"
#include "ui/aura/window_delegate.h"
+#include "ui/base/ime/text_input_client.h"
#include "ui/gfx/compositor/compositor_observer.h"
#include "webkit/glue/webcursor.h"
+namespace ui {
+class InputMethod;
+}
+
namespace WebKit {
class WebTouchEvent;
}
@@ -27,6 +32,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
public ui::CompositorObserver,
#endif
+ public ui::TextInputClient,
public aura::WindowDelegate {
public:
explicit RenderWidgetHostViewAura(RenderWidgetHost* host);
@@ -69,6 +75,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
int error_code) OVERRIDE;
virtual void Destroy() OVERRIDE;
virtual void SetTooltipText(const string16& tooltip_text) OVERRIDE;
+ virtual void SelectionBoundsChanged(const gfx::Rect& start_rect,
+ const gfx::Rect& end_rect) OVERRIDE;
virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE;
virtual void OnAcceleratedCompositingStateChange() OVERRIDE;
#if defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
@@ -98,6 +106,27 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
virtual bool LockMouse() OVERRIDE;
virtual void UnlockMouse() OVERRIDE;
+ // Overridden from ui::TextInputClient:
+ virtual void SetCompositionText(
+ const ui::CompositionText& composition) OVERRIDE;
+ virtual void ConfirmCompositionText() OVERRIDE;
+ virtual void ClearCompositionText() OVERRIDE;
+ virtual void InsertText(const string16& text) OVERRIDE;
+ virtual void InsertChar(char16 ch, int flags) OVERRIDE;
+ virtual ui::TextInputType GetTextInputType() const OVERRIDE;
+ virtual gfx::Rect GetCaretBounds() OVERRIDE;
+ virtual bool HasCompositionText() OVERRIDE;
+ virtual bool GetTextRange(ui::Range* range) OVERRIDE;
+ virtual bool GetCompositionTextRange(ui::Range* range) OVERRIDE;
+ virtual bool GetSelectionRange(ui::Range* range) OVERRIDE;
+ virtual bool SetSelectionRange(const ui::Range& range) OVERRIDE;
+ virtual bool DeleteRange(const ui::Range& range) OVERRIDE;
+ virtual bool GetTextFromRange(const ui::Range& range,
+ string16* text) OVERRIDE;
+ virtual void OnInputMethodChanged() OVERRIDE;
+ virtual bool ChangeTextDirectionAndLayoutAlignment(
+ base::i18n::TextDirection direction) OVERRIDE;
+
// Overridden from aura::WindowDelegate:
virtual void OnBoundsChanging(gfx::Rect* new_bounds) OVERRIDE;
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
@@ -126,6 +155,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
void UpdateCursorIfOverSelf();
+ // Gets the input method which use the ui::TextInputClient interface in this
+ // class.
+ ui::InputMethod* GetInputMethod();
+
// The model object.
RenderWidgetHost* host_;
@@ -148,6 +181,16 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
// removed from the list on an ET_TOUCH_RELEASED event.
WebKit::WebTouchEvent touch_event_;
+ // The current text input type.
+ ui::TextInputType text_input_type_;
+
+ // Rectangles before and after the selection.
+ gfx::Rect selection_start_rect_;
+ gfx::Rect selection_end_rect_;
+
+ // Indicates if there is onging composition text.
+ bool has_composition_text_;
+
// Current tooltip text.
string16 tooltip_;

Powered by Google App Engine
This is Rietveld 408576698