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

Issue 499004: Try 2: Completely redo how themes are stored on disk and processed at install time. (Closed)

Created:
11 years ago by Elliot Glaysher
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org, ben+cc_chromium.org, John Grabowski, Erik does not do reviews, Paul Godavari, Aaron Boodman, pam+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Try 2: Completely redo how themes are stored on disk and processed at install time. Same as previous patch, except we now have a BrowserThemeProvider::GetDefaultDisplayProperty() so we don't have UMRs in ntp_resource_cache.cc. BUG=24493, 21121 TEST=All the new unit tests pass. All the complex theme startup tests go faster. Previous Review URL: http://codereview.chromium.org/460050 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=34486

Patch Set 1 #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+1904 lines, -1560 lines) Patch
M base/base.gyp View 1 chunk +0 lines, -1 line 0 comments Download
M base/base.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M base/data_pack.h View 2 chunks +8 lines, -2 lines 0 comments Download
M base/data_pack.cc View 7 chunks +84 lines, -13 lines 0 comments Download
M base/data_pack_unittest.cc View 2 chunks +43 lines, -11 lines 0 comments Download
A chrome/browser/browser_theme_pack.h View 1 chunk +191 lines, -0 lines 1 comment Download
A chrome/browser/browser_theme_pack.cc View 1 chunk +864 lines, -0 lines 2 comments Download
A chrome/browser/browser_theme_pack_unittest.cc View 1 chunk +335 lines, -0 lines 1 comment Download
M chrome/browser/browser_theme_provider.h View 6 chunks +17 lines, -200 lines 1 comment Download
M chrome/browser/browser_theme_provider.cc View 15 chunks +156 lines, -962 lines 0 comments Download
M chrome/browser/browser_theme_provider_mac.mm View 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/browser_theme_provider_unittest.cc View 3 chunks +2 lines, -177 lines 0 comments Download
M chrome/browser/cocoa/download_shelf_controller.mm View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/theme_installed_infobar_delegate.cc View 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/gtk/download_shelf_gtk.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/gtk/gtk_theme_provider.h View 5 chunks +30 lines, -14 lines 0 comments Download
M chrome/browser/gtk/gtk_theme_provider.cc View 9 chunks +153 lines, -72 lines 0 comments Download
M chrome/browser/gtk/gtk_theme_provider_unittest.cc View 3 chunks +5 lines, -70 lines 0 comments Download
M chrome/browser/profile.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_constants.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/chrome_constants.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/pref_names.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/pref_names.cc View 1 chunk +1 line, -0 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_frame_inactive View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_frame_incognito View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_frame_incognito_inactive View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_frame_original View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_tab_background_incognito View 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/test/data/profiles/complex_theme/Default/Cached Theme Images/theme_tab_background_original View 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/test/data/profiles/complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/Cached Theme.pak View 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/test/data/profiles/complex_theme/Default/PreferencesTemplate View 1 chunk +1 line, -32 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Elliot Glaysher
This fixes the UMRs. I also noticed that while this patch doesn't increase complex_theme NTP ...
11 years ago (2009-12-14 20:14:03 UTC) #1
tony
LGTM http://codereview.chromium.org/499004/diff/1/11 File chrome/browser/browser_theme_provider.h (right): http://codereview.chromium.org/499004/diff/1/11#newcode152 chrome/browser/browser_theme_provider.h:152: // Returns true and sets the default property ...
11 years ago (2009-12-14 20:19:57 UTC) #2
Miranda Callahan
Some annoying little nits on second reading; otherwise LGTM! http://codereview.chromium.org/499004/diff/1/7 File chrome/browser/browser_theme_pack.cc (right): http://codereview.chromium.org/499004/diff/1/7#newcode202 chrome/browser/browser_theme_pack.cc:202: ...
11 years ago (2009-12-14 20:47:50 UTC) #3
Avi (use Gerrit)
I'm rather confused by what happened here re Mac theming. Things like GetNSColor() and GetNSColorTint() ...
10 years, 10 months ago (2010-02-12 21:58:05 UTC) #4
Elliot Glaysher
10 years, 10 months ago (2010-02-12 22:28:08 UTC) #5
On Fri, Feb 12, 2010 at 1:58 PM,  <avi@chromium.org> wrote:
> I'm rather confused by what happened here re Mac theming.
>
> Things like GetNSColor() and GetNSColorTint() explicitly state in their
> contract
> "If a theme does not provide [an color|tint with that id], this function
> will
> return nil." which is explicitly broken with this change. It looks like this
> was
> papered over with one-off fixes to the download shelf controller, and that
> was
> done directly with the theme functions rather than going through GTMTheme.
> :(

The current code (abridged) for GetNSColor is:

NSColor* BrowserThemeProvider::GetNSColor(int id) const {
  /* CODE CUT: Checks the nscolor_cache_ */

  SkColor sk_color;
  if (theme_pack_.get() && theme_pack_->GetColor(id, &sk_color)) {
    NSColor* color = /* ... */

    // We loaded successfully.  Cache the color.
    if (color) {
      nscolor_cache_[id] = [color retain];
      return color;
    }
  }

  return nil;
}

We only return a color (i) If we have a custom theme installed
(theme_pack_) and (ii) that theme contains specifies that color id.
Otherwise nil is returned. Note that we do the same thing in
BrowserThemeProvider::GetColor(), but fallback to
BrowserThemeProvider::GetDefaultColor() if the theme doesn't specify a
new color.

I think the confusion comes from BrowserThemePack::Get*()'s
documentation being wrong. I will prepare a patch.

-- Elliot

Powered by Google App Engine
This is Rietveld 408576698