Index: views/controls/button/custom_button.h |
diff --git a/views/controls/button/custom_button.h b/views/controls/button/custom_button.h |
index 9f2cb9fe8672648d4cbc964e21809d4711947269..5801401ab696a3c8c67dce7d9433ed8e7807c411 100644 |
--- a/views/controls/button/custom_button.h |
+++ b/views/controls/button/custom_button.h |
@@ -54,6 +54,13 @@ class CustomButton : public Button, |
return triggerable_event_flags_; |
} |
+ // Sets whether |RequestFocus| should be invoked on a mouse press. The default |
+ // is true. |
+ void set_request_focus_on_press(bool value) { |
+ request_focus_on_press_ = value; |
+ } |
+ bool request_focus_on_press() const { return request_focus_on_press_; } |
+ |
protected: |
// Construct the Button with a Listener. See comment for Button's ctor. |
explicit CustomButton(ButtonListener* listener); |
@@ -108,6 +115,9 @@ class CustomButton : public Button, |
// Mouse event flags which can trigger button actions. |
int triggerable_event_flags_; |
+ // See description above setter. |
+ bool request_focus_on_press_; |
+ |
DISALLOW_COPY_AND_ASSIGN(CustomButton); |
}; |