New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 661581 link

Starred by 6 users

Issue metadata

Status: Duplicate
Merged: issue 698795
Owner:
Last visit > 30 days ago
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Tab-modal dialogs don't display buttons on TouchBar

Project Member Reported by pinkerton@chromium.org, Nov 2 2016

Issue description

OS: 10.12.1+

On the latest MacBookPros with the TouchBar, app-modal dialogs have their buttons displayed on the bar. This is not the case for tab-modal dialogs like the bookmarks editor, or for bubbles (not sure if we want that...).

As we make changes to dialogs, we should ensure that we don't lose existing functionality in addition to trying to give tab-modals this functionality. 
 
Attaching pseudocode for -[NSAlert touchBar]. Looks like it uses a private class "NSButtonGroupTouchBarItem".
NSAlert-touchbar.txt
6.8 KB View Download
.. and another private thing called "NSAppearanceNameFunctionRow"

The buttons themselves are _NSTouchBarGroupButton (not vanilla NSButton). Vanilla NSButtons seem to work pretty nicely though.
NSButtonGroupTouchBarItem.txt
3.6 KB View Download
Can't find anything about special treatment for default buttons :/. It's probably a custom drawing routine. I couldn't find a reference to [NSButton setBezelColor:], but _NSTouchBarGroupButton inherits from NSButton - it might be manipulating some internals.
_NSTouchBarGroupButton.h
4.8 KB View Download
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c44c6a9a5b391a2081ed7259195ec1686482e2d0

commit c44c6a9a5b391a2081ed7259195ec1686482e2d0
Author: tapted <tapted@chromium.org>
Date: Mon Nov 07 02:29:37 2016

MacViews: TouchBar integration for toolkit-views dialogs.

Native Mac NSAlert dialogs show the dialog buttons on the TouchBar, we
want similar behaviour for Chrome dialogs.

If a Widget's delegate implements views::DialogDelegate, add buttons to
the touchbar for the "OK" and "Cancel" buttons. Note the labels might
not necessarily be labeled "OK" and "Cancel".

Nearly all dialogs and bubbles work correctly with the TouchBar this
way. One exception is the Add Bookmark bubble -
LocationBarBubbleDelegateView::GetDialogButtons() returns
ui::DIALOG_BUTTON_NONE. That makes sense for the ZoomBubble.
SaveCardBubbleViews overrides again to return both buttons and works.
The translate bubble has "TODO: This should be using GetDialogButtons."

Screenshot:  http://crbug.com/660126#c13 

BUG= 661581 

Review-Url: https://codereview.chromium.org/2469213002
Cr-Commit-Position: refs/heads/master@{#430209}

[modify] https://crrev.com/c44c6a9a5b391a2081ed7259195ec1686482e2d0/base/mac/sdk_forward_declarations.h
[modify] https://crrev.com/c44c6a9a5b391a2081ed7259195ec1686482e2d0/ui/base/BUILD.gn
[add] https://crrev.com/c44c6a9a5b391a2081ed7259195ec1686482e2d0/ui/base/cocoa/touch_bar_forward_declarations.h
[modify] https://crrev.com/c44c6a9a5b391a2081ed7259195ec1686482e2d0/ui/views/BUILD.gn
[add] https://crrev.com/c44c6a9a5b391a2081ed7259195ec1686482e2d0/ui/views/cocoa/bridged_content_view_touch_bar.mm

Comment 5 by tapted@chromium.org, Nov 16 2016

Cc: spqc...@chromium.org sdy@chromium.org
Labels: Proj-MacQualityOfLife Hotlist-Sierra
Status: Available (was: Untriaged)
[mac triage] any takers? r430209 added integration for Harmony dialogs, but they won't go out for at least a milestone. I haven't looked into what's involved for doing this for the Cocoa dialogs.

Comment 6 by sdy@chromium.org, Dec 1 2016

Labels: -Proj-MacQualityOfLife Hotlist-MacQualityOfLife
Labels: -Hotlist-MacQualityOfLife Hotlist-PlatformExcellence
Migrating to more generic platform label, so that it can be applied to other platforms (i.e. I love the idea).
Owner: patricia...@chromium.org
Status: Assigned (was: Available)
Will take a look at this after this week.
Components: -UI>Browser>Core UI>Browser>Touchbar
Cc: -spqc...@chromium.org
Owner: spqc...@chromium.org
Labels: -Hotlist-PlatformExcellence
Mergedinto: 698795
Status: Duplicate (was: Assigned)

Sign in to add a comment