Bug fix: Combobox: Focus on clicking mouse button

This CL fixes the regression that Combobox doesn't get focused when
clicking a right button of a mouse. Before introducing
TransparentButton, Combobox can get focus by itself on the mouse button
events, but now, TranparentButton robs the combobox of the events.
This CL has TransparentButton::OnMousePressed help the combobox with
focusing it.

BUG=350811
TEST=manual

Review URL: https://codereview.chromium.org/189913014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256016 0039d316-1c4b-4281-b951-d872f2087c98
parent 1744f4f9
...@@ -91,6 +91,11 @@ class TransparentButton : public CustomButton { ...@@ -91,6 +91,11 @@ class TransparentButton : public CustomButton {
} }
virtual ~TransparentButton() {} virtual ~TransparentButton() {}
virtual bool OnMousePressed(const ui::MouseEvent& mouse_event) OVERRIDE {
parent()->RequestFocus();
return true;
}
double GetAnimationValue() const { double GetAnimationValue() const {
return hover_animation_->GetCurrentValue(); return hover_animation_->GetCurrentValue();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment