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

Issue 2604793002: Allow Widget to pass accelerator handling to its parent.

Created:
3 years, 12 months ago by alshabalin
Modified:
3 years, 10 months ago
Reviewers:
tapted, sky, msw
CC:
chromium-reviews, groby+bubble_chromium.org, tfarina, msw+watch_chromium.org, hcarmona+bubble_chromium.org, mac-reviews_chromium.org, rouslan+bubble_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow Widget to pass accelerator handling to its parent. This enables passing of both ui::Accelerator and Mac-specific commands from Widget to its parent regulated by Widget::InitParams:: pass_accelerator_to_parent. Regular views accelerator handling involves overriding FocusManagerDelegate which forwards all requests to parent's FocusManager. Mac-specific handling is done by overriding UserInterfaceItemCommandHandler which forwards all request to parent's NSWindow (if it supports CommandDispatchingWindow protocol). BUG=603881

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+612 lines, -4 lines) Patch
M ui/views/BUILD.gn View 2 chunks +4 lines, -0 lines 0 comments Download
M ui/views/bubble/bubble_dialog_delegate.cc View 1 chunk +1 line, -0 lines 0 comments Download
A ui/views/cocoa/native_widget_mac_accelerator_handler.h View 1 chunk +19 lines, -0 lines 0 comments Download
A ui/views/cocoa/native_widget_mac_accelerator_handler.mm View 1 chunk +59 lines, -0 lines 0 comments Download
M ui/views/view.cc View 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/widget/native_widget_mac.mm View 2 chunks +14 lines, -1 line 2 comments Download
M ui/views/widget/native_widget_mac_unittest.mm View 5 chunks +170 lines, -0 lines 0 comments Download
M ui/views/widget/widget.h View 4 chunks +11 lines, -0 lines 0 comments Download
M ui/views/widget/widget.cc View 5 chunks +29 lines, -2 lines 0 comments Download
A ui/views/widget/widget_accelerator_handling_delegate.h View 1 chunk +42 lines, -0 lines 0 comments Download
A ui/views/widget/widget_accelerator_handling_delegate.cc View 1 chunk +72 lines, -0 lines 0 comments Download
M ui/views/widget/widget_unittest.cc View 1 chunk +189 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
alshabalin
I've enabled accelerator passing for all BubbleDialogDelegate bubbles but it's probably better to start doing ...
3 years, 12 months ago (2016-12-27 14:50:40 UTC) #3
msw
msw->sky; I'm not sure that the overall approach here is appropriate.
3 years, 11 months ago (2016-12-28 19:21:12 UTC) #5
tapted
We need to have a discussion on a bug about this. http://crbug.com/603881 is assigned to ...
3 years, 11 months ago (2017-01-02 23:11:49 UTC) #6
alshabalin
On 2017/01/02 23:11:49, tapted wrote: > We need to have a discussion on a bug ...
3 years, 11 months ago (2017-01-09 14:04:23 UTC) #7
tapted
3 years, 10 months ago (2017-02-01 23:56:27 UTC) #8
On 2017/01/09 14:04:23, alshabalin wrote:
> On 2017/01/02 23:11:49, tapted wrote:
> > We need to have a discussion on a bug about this.
> > 
> > http://crbug.com/603881 is assigned to me, but it's a bug for the Cocoa
> browser
> > and Cocoa dialogs. It's not related to toolkit-views (it is effectively
> > obsolete). It can't be used for this.
> > 
> > For MacViews there is http://crbug.com/605374 but I closed it as WontFix.
The
> > reason is that the closest Cocoa UI element to a Chrome "bubble" is
NSPopover.
> > Cmd+w while an NSPopover is visible closes the popover only - it shouldn't
be
> > passed to the parent window.
> > 
> > However, for other keyboard shortcuts, we might want to do something else -
we
> > need a new bug that talks about the use-cases we need to solve. Maybe your
> team
> > has encountered a specific behaviour that feels broken? (can you file a new
> > bug?)
> 
> Opened a bug: crbug.com/679339
> In short: inability to use browser shortcuts, when bubble gets shown without
you
> asking
> for it can get a little annoying.

I have a CL in https://codereview.chromium.org/2666523002/ which should address
http://crbug.com/603881 in a way that shares the Mac-specific command
dispatching logic used for mainMenu integration with toolkit-views bubbles. Not
much changes under ui/views -- native_widget_mac_nswindow gets a bit simpler
since some logic moves into ui/base/cocoa/command_dispatcher.mm

Powered by Google App Engine
This is Rietveld 408576698