| Index: content/renderer/render_widget.cc
|
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
| index d17cf0804803d5c7cd3b507705f366db3ed8c993..b25bfd8597d699fc747b217e214dbd592c2b20de 100644
|
| --- a/content/renderer/render_widget.cc
|
| +++ b/content/renderer/render_widget.cc
|
| @@ -1744,12 +1744,13 @@ void RenderWidget::UpdateTextInputState(ShowIme show_ime,
|
| }
|
| #endif
|
|
|
| -void RenderWidget::GetSelectionBounds(gfx::Rect* focus, gfx::Rect* anchor) {
|
| +bool RenderWidget::GetSelectionBounds(gfx::Rect* focus, gfx::Rect* anchor) {
|
| WebRect focus_webrect;
|
| WebRect anchor_webrect;
|
| webwidget_->selectionBounds(focus_webrect, anchor_webrect);
|
| *focus = focus_webrect;
|
| *anchor = anchor_webrect;
|
| + return true;
|
| }
|
|
|
| void RenderWidget::UpdateSelectionBounds() {
|
| @@ -1758,16 +1759,23 @@ void RenderWidget::UpdateSelectionBounds() {
|
| if (handling_ime_event_)
|
| return;
|
|
|
| - ViewHostMsg_SelectionBounds_Params params;
|
| - GetSelectionBounds(¶ms.anchor_rect, ¶ms.focus_rect);
|
| - if (selection_anchor_rect_ != params.anchor_rect ||
|
| - selection_focus_rect_ != params.focus_rect) {
|
| - selection_anchor_rect_ = params.anchor_rect;
|
| - selection_focus_rect_ = params.focus_rect;
|
| + gfx::Rect anchor_rect, focus_rect;
|
| + if (GetSelectionBounds(&anchor_rect, &focus_rect) &&
|
| + (selection_anchor_rect_ != anchor_rect ||
|
| + selection_focus_rect_ != focus_rect)) {
|
| + selection_anchor_rect_ = anchor_rect;
|
| + selection_focus_rect_ = focus_rect;
|
| +
|
| + ViewHostMsg_SelectionBounds_Params params;
|
| + params.anchor_rect = anchor_rect;
|
| + params.focus_rect = focus_rect;
|
| webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir);
|
| params.is_anchor_first = webwidget_->isSelectionAnchorFirst();
|
| + params.is_anchor_visible = true;
|
| + params.is_focus_visible = true;
|
| Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params));
|
| }
|
| +
|
| #if defined(OS_MACOSX) || defined(USE_AURA)
|
| UpdateCompositionInfo(false);
|
| #endif
|
|
|