Extension toolbar buttons contain an icon, an optional badge, and potentially "some additional state" (which could be pressed/hover decorations, a blocked action indication, etc). Right now, the icon and badge are both handled by IconWithBadgeImageSource, while the button state is handled by the native UI elements.
The advantage to drawing icons in IconWithBadgeImageSource is that it is shared cross-platform, meaning we don't have to reimplement the same logic for Views platforms and Mac. However, with the addition of the blocked actions decoration, we're now passing in more button state information, and likely that decoration should be drawn by the bubble instead. We probably don't want to move *all* logic for icon drawing into the button UI elements, because it's rather complicated (depending on extension state, active tab, etc). However, there should be a clean delineation.
For now, we can isolate all the drawing in IconWithBadgeImageSource, but we should consider pulling pieces (such as the blocked action decoration) out into the button itself. Once MacViews ships for the toolbar, this will make even more sense (since we will again only have to implement once).
Comment 1 by rdevlin....@chromium.org
, May 14 2018Labels: OS-Chrome OS-Mac OS-Windows