diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 20:58:30 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 20:58:30 +0000 |
commit | f30ce3b15d2221e2d7a5126b969199bdcd0337ec (patch) | |
tree | 639c808e252b5dd62f6c9936ee45628d0cb06b98 | |
parent | 1894c45056cc5d0ce54f850f670a94bf3c7ce4d5 (diff) | |
download | chromium_src-f30ce3b15d2221e2d7a5126b969199bdcd0337ec.zip chromium_src-f30ce3b15d2221e2d7a5126b969199bdcd0337ec.tar.gz chromium_src-f30ce3b15d2221e2d7a5126b969199bdcd0337ec.tar.bz2 |
Fixes the implementation of TabContentsViewMac::TakeFocus().
Review URL: http://codereview.chromium.org/99245
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14991 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view_mac.mm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index bcf7ab4..d9a3ada4 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -126,8 +126,14 @@ void TabContentsViewMac::UpdateDragCursor(bool is_drop_target) { NOTIMPLEMENTED(); } +// This is called when we the renderer asks us to take focus back (i.e., it has +// iterated past the last focusable element on the page). void TabContentsViewMac::TakeFocus(bool reverse) { - [cocoa_view_.get() becomeFirstResponder]; + if (reverse) { + [[cocoa_view_ window] selectPreviousKeyView:cocoa_view_.get()]; + } else { + [[cocoa_view_ window] selectNextKeyView:cocoa_view_.get()]; + } } void TabContentsViewMac::HandleKeyboardEvent( |