summaryrefslogtreecommitdiffstats
path: root/chrome/views/controls/button/native_button.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 00:11:44 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 00:11:44 +0000
commit3a21be61ee6d17f5c6c06bfcddd881bd76b42e9a (patch)
treef1057057c7d81495dc177b2c4302701d65420d3b /chrome/views/controls/button/native_button.cc
parent7cf4621942f87e87a3e101a9cfadb8309a5e59b7 (diff)
downloadchromium_src-3a21be61ee6d17f5c6c06bfcddd881bd76b42e9a.zip
chromium_src-3a21be61ee6d17f5c6c06bfcddd881bd76b42e9a.tar.gz
chromium_src-3a21be61ee6d17f5c6c06bfcddd881bd76b42e9a.tar.bz2
Focusing a native button through a RequestFocus call would not result in the actual button showing as focused.
This is because the NativeButton is the one getting focused not the NativeControl wrapper. This CL adds forwarding the focus to the NativeControl so the HWND really gets focused. It also associates the NativeButton view with the NativeControl, so that when the HWND is focused (through a click for example), the focus manager has the NativeButton as the focused view (not the NativeControl wrapper). BUG=9253 TEST=Open the option panel. Press tab several times. The focus should move as expected to the different buttons and views in the page. Review URL: http://codereview.chromium.org/45042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/controls/button/native_button.cc')
-rw-r--r--chrome/views/controls/button/native_button.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/views/controls/button/native_button.cc b/chrome/views/controls/button/native_button.cc
index 3175c9a..f8c7c5d 100644
--- a/chrome/views/controls/button/native_button.cc
+++ b/chrome/views/controls/button/native_button.cc
@@ -138,6 +138,13 @@ bool NativeButton::AcceleratorPressed(const Accelerator& accelerator) {
return false;
}
+void NativeButton::Focus() {
+ Button::Focus();
+ // Forward the focus to the wrapper.
+ if (native_wrapper_)
+ native_wrapper_->SetFocus();
+}
+
////////////////////////////////////////////////////////////////////////////////
// NativeButton, protected: