Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6224)

Unified Diff: chrome/views/controls/button/native_button_win.cc

Issue 45042: Fix for native button focus bug (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/views/controls/button/native_button_win.cc
===================================================================
--- chrome/views/controls/button/native_button_win.cc (revision 12376)
+++ chrome/views/controls/button/native_button_win.cc (working copy)
@@ -18,6 +18,10 @@
NativeButtonWin::NativeButtonWin(NativeButton* native_button)
: NativeControlWin(),
native_button_(native_button) {
+ // Associates the actual HWND with the native_button so the native_button is
+ // the one considered as having the focus (not the wrapper) when the HWND is
+ // focused directly (with a click for example).
+ SetAssociatedFocusView(native_button);
}
NativeButtonWin::~NativeButtonWin() {
@@ -48,6 +52,11 @@
return this;
}
+void NativeButtonWin::SetFocus() {
+ // Focus the associated HWND.
+ Focus();
+}
+
////////////////////////////////////////////////////////////////////////////////
// NativeButtonWin, View overrides:
@@ -135,6 +144,11 @@
SendMessage(GetHWND(), BM_SETSTATE, pushed, 0);
}
+void NativeCheckboxWin::SetFocus() {
+ // The focus should stay on the views::Checkbox (more precisely, on the
+ // label, which is a view).
+}
+
////////////////////////////////////////////////////////////////////////////////
// NativeCheckboxWin, NativeButtonWin overrides:
@@ -216,4 +230,3 @@
}
} // namespace views
-
« no previous file with comments | « chrome/views/controls/button/native_button_win.h ('k') | chrome/views/controls/button/native_button_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698