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

Unified Diff: views/controls/button/custom_button.cc

Issue 2741004: Makes it so child views of menuitemview can be traversed with the (Closed)
Patch Set: Tweaks Created 10 years, 6 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: views/controls/button/custom_button.cc
diff --git a/views/controls/button/custom_button.cc b/views/controls/button/custom_button.cc
index 534c8a4170718ce45615caf0f191f06a56a23122..8bf68b21ee30bccc8f75a87553be3507c32cc44f 100644
--- a/views/controls/button/custom_button.cc
+++ b/views/controls/button/custom_button.cc
@@ -74,7 +74,8 @@ CustomButton::CustomButton(ButtonListener* listener)
: Button(listener),
state_(BS_NORMAL),
animate_on_state_change_(true),
- triggerable_event_flags_(MouseEvent::EF_LEFT_BUTTON_DOWN) {
+ triggerable_event_flags_(MouseEvent::EF_LEFT_BUTTON_DOWN),
+ request_focus_on_press_(true) {
hover_animation_.reset(new ThrobAnimation(this));
hover_animation_->SetSlideDuration(kHoverFadeDurationMs);
}
@@ -101,7 +102,8 @@ bool CustomButton::OnMousePressed(const MouseEvent& e) {
if (state_ != BS_DISABLED) {
if (ShouldEnterPushedState(e) && HitTest(e.location()))
SetState(BS_PUSHED);
- RequestFocus();
+ if (request_focus_on_press_)
+ RequestFocus();
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698