Skip to content

Commit

Permalink
mac: Make services menu work after hitting "select all"
Browse files Browse the repository at this point in the history
The problem was that "select all" didn't go through
RenderViewHostImpl::SelectAll(). That method has the effect of setting
handling_select_range_ in RenderViewImpl::OnSelectAll(). Previously, this
bool wasn't set, causing RenderViewImpl::didChangeSelection() to return early,
which in turn meant that the browser process wasn't informed about the updated
selection.

BUG=114870
TEST=Focus a text box, enter some text, hit cmd-a. Check that text services
are selectable in the services menu.

Review URL: https://codereview.chromium.org/12398005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185904 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
thakis@chromium.org committed Mar 4, 2013
1 parent a7f9748 commit 73eac2e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions content/browser/renderer_host/render_widget_host_view_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3351,6 +3351,20 @@ - (void)pasteAndMatchStyle:(id)sender {
}
}

- (void)selectAll:(id)sender {
// editCommand_helper_ adds implementations for most NSResponder methods
// dynamically. But the renderer side only sends selection results back to
// the browser if they were triggered by a keyboard event or went through
// one of the Select methods on RWH. Since selectAll: is called from the
// menu handler, neither is true.
// Explicitly call SelectAll() here to make sure the renderer returns
// selection results.
if (renderWidgetHostView_->render_widget_host_->IsRenderView()) {
static_cast<RenderViewHostImpl*>(
renderWidgetHostView_->render_widget_host_)->SelectAll();
}
}

- (void)startSpeaking:(id)sender {
renderWidgetHostView_->SpeakSelection();
}
Expand Down

0 comments on commit 73eac2e

Please sign in to comment.