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

Issue 2687633002: Fix using theme colors for the download shelf's close button. (Closed)

Created:
3 years, 10 months ago by Sidney San Martín
Modified:
3 years, 10 months ago
Reviewers:
CC:
chromium-reviews
Target Ref:
refs/pending/branch-heads/2987
Project:
chromium
Visibility:
Public.

Description

Fix using theme colors for the download shelf's close button. The theme world is messy: - ThemeProvider encapsulates some state like incognito status, but not other state like whether the active or inactive version of a color should be used (e.g. COLOR_TAB_TEXT vs. COLOR_BACKGROUND_TAB_TEXT). - A browser window always(?) has a ThemeProvider, but since some views try to access theme information when they're not in a window, there are null checks all over. - Some views listen for theme callbacks. Others, like HoverCloseButton, expect to be told to redraw when the theme changes. - -[TabView iconColor] modifies a theme color by tweaking its alpha and wants its children to use it. It also returns a hard-coded color that isn't in the theme at all for "dark" themes. This isn't really supported by the theme system. The issue that this CL fixes was the result of HoverCloseButton expecting to be a child of a TabView and falling back to a default color. This fix doesn't really change that dependency, but it lets anyone set the color instead of assuming a TabView parent. It will still use a default color if nobody tells it otherwise, since it doesn't look at the theme itself. A more complex solution would let HoverCloseButton pull a color from the theme but allow that color to be overridden (by TabView), but that doesn't seem worth it. I'd be a fan of rethinking details of how we deal with themes to make issues like this harder to come by. BUG=656553 Review-Url: https://codereview.chromium.org/2668393003 Cr-Commit-Position: refs/heads/master@{#447826} (cherry picked from commit 524a361c86c23bb4f5384c1738f786532a296e46) Review-Url: https://codereview.chromium.org/2687633002 . Cr-Commit-Position: refs/branch-heads/2987@{#379} Cr-Branched-From: ad51088c0e8776e8dcd963dbe752c4035ba6dab6-refs/heads/master@{#444943} Committed: https://chromium.googlesource.com/chromium/src/+/9adf7c095e768a3ab1e0b3aed26379ff5c3f8973

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -25 lines) Patch
M chrome/app/nibs/DownloadShelf.xib View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm View 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/hover_close_button.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/hover_close_button.mm View 6 chunks +13 lines, -17 lines 0 comments Download
M chrome/browser/ui/cocoa/tabs/tab_view.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/cocoa/tabs/tab_view.mm View 3 chunks +6 lines, -4 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
Sidney San Martín
3 years, 10 months ago (2017-02-08 03:06:38 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
9adf7c095e768a3ab1e0b3aed26379ff5c3f8973.

Powered by Google App Engine
This is Rietveld 408576698