New issue
Advanced search Search tips

Issue 766897 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Not implemented reached in virtual void views::NativeWidgetMac::SetWindowIcons

Project Member Reported by erikc...@chromium.org, Sep 20 2017

Issue description

Running Canary with error logging on macOS, 10.12.6. Got a fair number of views-related error messages.

"""
 10 [6804:775:0918/125931.567667:ERROR:native_widget_mac.mm(281)] Not implemented reached in virtual void views::NativeWidgetMac::SetWindowIcons(const gfx::ImageSkia &, const gfx::Ima    geSkia &)
"""
 
Google Chrome	63.0.3218.0 (Official Build) canary (64-bit)
Revision	8634c0eac009323c45c362e9308429d8f1e1976b-refs/heads/master@{#502516}

Comment 2 by tapted@chromium.org, Sep 20 2017

Owner: tapted@chromium.org
Status: Assigned (was: Untriaged)
yeah I should just nerf that. Thanks for filing this bug :)

For a while I thought I could put icons next to the items in the `Window` mainMenu item (https://chromium-review.googlesource.com/c/chromium/src/+/560934), but that was a failed experiment.

per-window icons are just not a thing on Mac.

Comment 3 by tapted@chromium.org, Sep 20 2017

hm, but also I'm assuming you're using --secondary-ui-md or invoking permission bubbles (or using WebPayments). Only MacViews UI should tickle this.

I see pairs of errors like

[45085:775:0920/103946.177318:ERROR:native_widget_mac.mm(329)] Not implemented reached in virtual void views::NativeWidgetMac::StackAbove(gfx::NativeView)
[45085:775:0920/104043.678651:ERROR:native_widget_mac.mm(281)] Not implemented reached in virtual void views::NativeWidgetMac::SetWindowIcons(const gfx::ImageSkia &, const gfx::ImageSkia &)

whenever a window is created.

With a mac_views_browser, there might be a lot more since the tab loading spinner animation can update the taskbar icon on Windows.

I toyed with Version 63.0.3219.0 (Official Build) canary (64-bit) and don't see any error spew in the console (i.e. only once, each time a dialog is created).
Yeah, I turned on all the flags that pkasting sent out for that.
oh nvm, those were flags for the ominbox. probalby unrelated. I just turned on "--secondary-ui-md", so that's not it. Must be permission bubbles.

Comment 6 by tapted@chromium.org, Sep 20 2017

ooozomg maybe we *can* set the icon. In the dock context menu at least

[[NSWindow standardWindowButton:NSWindowDocumentIconButton] setImage:customImage].

how could would that be if it was favicons :O

(or would it suck? Opinions?)

Currently it's boring.

It's boring in Safari too, but Safari doesn't put favicons on Tabs either, and ppl throw hate at Safari for it.
Screen Shot 2017-09-20 at 3.56.09 pm.png
183 KB View Download
Screen Shot 2017-09-20 at 3.56.31 pm.png
115 KB View Download

Comment 7 by tapted@chromium.org, Sep 20 2017

ugh - looks like more hackery is needed. We can only set the icon next to a title in the titlebar. Icons in the Dock menus are only shown for closed "document" windows - as soon as you open the document, it becomes the boring/generic window icon.

We *do* set titles in the titlebar for popups and PWAs (types of browser window). So the following:

void NativeWidgetMac::SetWindowIcons(const gfx::ImageSkia& window_icon,
                                     const gfx::ImageSkia& app_icon) {
  [GetNativeWindow() setRepresentedURL:[[[NSURL alloc] init] autorelease]];
  [[GetNativeWindow() standardWindowButton:NSWindowDocumentIconButton]
      setImage:NSImageFromImageSkiaWithColorSpace(
                   window_icon, base::mac::GetSRGBColorSpace())];
}

results in the attached (in mac_views_browser = true).

This would all need review, so I'm just going to nerf the NOTIMPLEMENTED for now.
Screen Shot 2017-09-20 at 4.44.01 pm.png
60.9 KB View Download
Project Member

Comment 8 by bugdroid1@chromium.org, Sep 21 2017

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

commit cee8f765609d27529d22ed4f4a4cc30e28afb824
Author: Trent Apted <tapted@chromium.org>
Date: Thu Sep 21 05:19:18 2017

Silence NOTIMPLMENTEDs() in NativeWidgetMac::SetWindowIcons(), StackAbove().

It doesn't make sense to implement these on Mac for now, and they litter
logs with noise.

Bug:  766897 
Change-Id: Ieb1224b4ef13a7a2cc76a078eaa687ba7a63b4d1
Reviewed-on: https://chromium-review.googlesource.com/674546
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503359}
[modify] https://crrev.com/cee8f765609d27529d22ed4f4a4cc30e28afb824/ui/views/widget/native_widget_mac.mm

Comment 9 by tapted@chromium.org, Sep 21 2017

Status: Fixed (was: Assigned)

Sign in to add a comment