summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 19:37:28 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 19:37:28 +0000
commit5fee6eb5af83fcbd311acc21fb394ebc5f9d0956 (patch)
tree2ab183bb508dccbdf0de584833e3c6ca4792d8ff /chrome/views
parent137ad0c8acd634e11925bce6a605e51a989ac0ff (diff)
downloadchromium_src-5fee6eb5af83fcbd311acc21fb394ebc5f9d0956.zip
chromium_src-5fee6eb5af83fcbd311acc21fb394ebc5f9d0956.tar.gz
chromium_src-5fee6eb5af83fcbd311acc21fb394ebc5f9d0956.tar.bz2
When a native button was getting focused we were calling the View::Focus() method which would focus the RootView HWND confusing the button and the click would not trigger WM_COMMAND.
When the button was already focused, we were not setting the focus and the WM_COMMAND was sent correctly. BUG=9273 TEST=Open the option dialog, click the Manage button in the "Default search" section. This should bring up the dialog. Close the dialog, the focus should be on the Manage button. Review URL: http://codereview.chromium.org/42616 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/controls/button/native_button.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/views/controls/button/native_button.cc b/chrome/views/controls/button/native_button.cc
index a8c9c53..7a4529b 100644
--- a/chrome/views/controls/button/native_button.cc
+++ b/chrome/views/controls/button/native_button.cc
@@ -145,10 +145,12 @@ bool NativeButton::AcceleratorPressed(const Accelerator& accelerator) {
}
void NativeButton::Focus() {
- Button::Focus();
// Forward the focus to the wrapper.
if (native_wrapper_)
native_wrapper_->SetFocus();
+ else
+ Button::Focus(); // Will focus the RootView window (so we still get
+ // keyboard messages).
}
////////////////////////////////////////////////////////////////////////////////