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

Unified Diff: ui/views/controls/button/custom_button.h

Issue 1994463002: MacViews: Make buttons not request focus on mouse press. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button.h
diff --git a/ui/views/controls/button/custom_button.h b/ui/views/controls/button/custom_button.h
index 82ea7525567d7aeb2a84293ebb208e5785f1f64c..ee8ce88e7c3d31560f0992964e0bba41eb3623c9 100644
--- a/ui/views/controls/button/custom_button.h
+++ b/ui/views/controls/button/custom_button.h
@@ -8,6 +8,7 @@
#include <memory>
#include "base/macros.h"
+#include "build/build_config.h"
#include "ui/events/event_constants.h"
#include "ui/gfx/animation/animation_delegate.h"
#include "ui/gfx/animation/throb_animation.h"
@@ -62,8 +63,13 @@ class VIEWS_EXPORT CustomButton : public Button, public gfx::AnimationDelegate {
// Sets whether |RequestFocus| should be invoked on a mouse press. The default
// is false.
void set_request_focus_on_press(bool value) {
+// On Mac, buttons should not request focus on a mouse press. Hence keep the
+// default value i.e. false.
+#if !defined(OS_MACOSX)
request_focus_on_press_ = value;
+#endif
}
+
bool request_focus_on_press() const { return request_focus_on_press_; }
// See description above field.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698