Index: chrome/browser/renderer_host/render_widget_host_view_mac.h |
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h |
index 048f4027345a8fa7a4bd382f9c080ed310b9624d..576ce97768cfd5ee7e37b59b4c1d34ec32a76dce 100644 |
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.h |
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h |
@@ -73,12 +73,6 @@ class RWHVMEditCommandHelper; |
// Represents the input-method attributes supported by this object. |
scoped_nsobject<NSArray> validAttributesForMarkedText_; |
- // Represents the cursor position in this view coordinate. |
- // The renderer sends the cursor position through an IPC message. |
- // We save the latest cursor position here and return it when an input |
- // methods needs it. |
- NSRect caretRect_; |
- |
// Indicates if we are currently handling a key down event. |
BOOL handlingKeyDown_; |
@@ -95,11 +89,7 @@ class RWHVMEditCommandHelper; |
// the whole content yet. |
NSRange markedRange_; |
- // The selected range inside current marked text. |
- // TODO(suzhe): Currently it's only valid when there is any marked text. |
- // In the future, we may need to support accessing the whole content of the |
- // DOM node being edited, then this should be the selected range inside the |
- // DOM node. |
+ // The selected range, cached from a message sent by the renderer. |
NSRange selectedRange_; |
// Text to be inserted which was generated by handling a key down event. |
@@ -130,7 +120,7 @@ class RWHVMEditCommandHelper; |
BOOL mouseEventWasIgnored_; |
} |
-@property(assign, nonatomic) NSRect caretRect; |
+@property(nonatomic, readonly) NSRange selectedRange; |
- (void)setCanBeKeyView:(BOOL)can; |
- (void)setTakesFocusOnlyOnMouseDown:(BOOL)b; |
@@ -206,6 +196,7 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView { |
virtual void ImeUpdateTextInputState(WebKit::WebTextInputType state, |
const gfx::Rect& caret_rect); |
virtual void ImeCancelComposition(); |
+ virtual void ImeCompositionRangeChanged(const ui::Range& range); |
virtual void DidUpdateBackingStore( |
const gfx::Rect& scroll_rect, int scroll_dx, int scroll_dy, |
const std::vector<gfx::Rect>& copy_rects); |
@@ -214,7 +205,8 @@ class RenderWidgetHostViewMac : public RenderWidgetHostView { |
virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) {}; |
virtual void Destroy(); |
virtual void SetTooltipText(const std::wstring& tooltip_text); |
- virtual void SelectionChanged(const std::string& text); |
+ virtual void SelectionChanged(const std::string& text, |
+ const ui::Range& range); |
virtual BackingStore* AllocBackingStore(const gfx::Size& size); |
virtual void SetTakesFocusOnlyOnMouseDown(bool flag); |
// See comment in RenderWidgetHostView! |