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

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

Issue 1544803004: Fix accelerator handling for in-menu buttons in the app menu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable the check on ChromeOS (again). Accelerator handling in extension popups is different betwee… Created 4 years, 10 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 | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 3ab8303e9f8821d8dd77e1f7ba7308153cd78a60..86fca746d59c3894bddfe1c6250ee2e22d279708 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -263,13 +263,6 @@ void CustomButton::OnGestureEvent(ui::GestureEvent* event) {
}
bool CustomButton::AcceleratorPressed(const ui::Accelerator& accelerator) {
- // Should only handle accelerators when active. However, only top level
- // widgets can be active, so for child widgets check if they are focused
- // instead.
- if ((IsChildWidget() && !FocusInChildWidget()) ||
- (!IsChildWidget() && !GetWidget()->IsActive())) {
- return false;
- }
SetState(STATE_NORMAL);
// TODO(beng): remove once NotifyClick takes ui::Event.
ui::MouseEvent synthetic_event(
@@ -440,14 +433,4 @@ void CustomButton::OnClickCanceled(const ui::Event& event) {
Button::OnClickCanceled(event);
}
-bool CustomButton::IsChildWidget() const {
- return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget();
-}
-
-bool CustomButton::FocusInChildWidget() const {
- return GetWidget() &&
- GetWidget()->GetRootView()->Contains(
- GetFocusManager()->GetFocusedView());
-}
-
} // namespace views
« no previous file with comments | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698