summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_theme_provider.cc
Commit message (Collapse)AuthorAgeFilesLines
* Take 2 at: Fix the opacity of titlebars on the NTP page.tony@chromium.org2009-12-021-2/+2
| | | | | | | | | | | | We were accidentally setting the opacity to 1/255. This bug was introduced in r32643. Fix the unittest too. BUG=29107 Review URL: http://codereview.chromium.org/461003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33529 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 33526 - Fix the opacity of titlebars on the NTP page. We were ↵tony@chromium.org2009-12-021-2/+2
| | | | | | | | | | | | | | | | | accidentally setting the opacity to 1/255. This bug was introduced in r32643. BUG=29107 Review URL: http://codereview.chromium.org/452040 TBR=tony@chromium.org Review URL: http://codereview.chromium.org/460004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33528 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the opacity of titlebars on the NTP page. We were accidentallytony@chromium.org2009-12-021-2/+2
| | | | | | | | | | | | setting the opacity to 1/255. This bug was introduced in r32643. BUG=29107 Review URL: http://codereview.chromium.org/452040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33526 0039d316-1c4b-4281-b951-d872f2087c98
* Many changes to DictionaryValues:pkasting@chromium.org2009-11-251-12/+13
| | | | | | | | | | | | | | | | | * Add support for keys with "." in them via new XXXWithoutPathExpansion() APIs. * Use these APIs with all key iterator usage. * SetXXX() calls cannot fail, so change them from bool to void. * Change GetSize() to size() since it's cheap, and add empty(). Other: * Use standard for loop format in more places (e.g. instead of while loops when they're really doing a for loop). * Shorten a few bits of code. BUG=567 TEST=none Review URL: http://codereview.chromium.org/441008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33109 0039d316-1c4b-4281-b951-d872f2087c98
* Move some theme images to being serviced on the IO thread. Fortony@chromium.org2009-11-241-1/+6
| | | | | | | | | | | | | | | | | Linux Release builds on my machine, all the chrome://theme/ image requests block for 300-400ms during browser startup (it's faster after startup). Something is blocking the UI thread so move image requests that aren't themed off the UI thread. This is safe to do because ResourceBundle is thread safe. I still see chrome://theme/theme_ntp_attribution and chrome://theme/theme_ntp_background blocking so I will look into those next (I think with the default theme, they shouldn't be loaded at all). Review URL: http://codereview.chromium.org/440009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32985 0039d316-1c4b-4281-b951-d872f2087c98
* Remove ResourceBundle::LoadImageResourceBytes since it appears totony@chromium.org2009-11-231-1/+1
| | | | | | | | | be identical to LoadDataResourceBytes. Migrate callers to LoadDataResourceBytes. Review URL: http://codereview.chromium.org/437019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32885 0039d316-1c4b-4281-b951-d872f2087c98
* - Start adding unit tests for the BrowserThemeProvider rewrite.erg@google.com2009-11-201-3/+4
| | | | | | | | | | - Fix overflow error in colors. BUG=21121 Review URL: http://codereview.chromium.org/414041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32643 0039d316-1c4b-4281-b951-d872f2087c98
* Style cleanups for BrowserThemeProvider. Move the globaltony@chromium.org2009-11-171-53/+62
| | | | | | | | | | | | stl containers into helper functions to defer init and to ensure we only initialize once. Move some consts into the namespace. TEST=none BUG=none Review URL: http://codereview.chromium.org/399042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32214 0039d316-1c4b-4281-b951-d872f2087c98
* Use plain strings instead of wstrings for UMA actionsevan@chromium.org2009-11-171-4/+4
| | | | | | | | | | | | git grep 'RecordAction(L' | xargs sed -i -e s/RecordAction(L/RecordAction(/ This cuts more than 10k off my binary. Which is nothing compared to the size of the binary, but that's a whole lot of zero bytes! This is less code this way anyway. Review URL: http://codereview.chromium.org/399026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32194 0039d316-1c4b-4281-b951-d872f2087c98
* Make PNGCodec::Decode(...) not make an intermediary copy of the decoded data;erg@google.com2009-10-221-10/+3
| | | | | | | | | | | instead have it write directly to the returned SkBitmap. BUG=http://crbug.com/24493 TEST=Perf should get better. On the perf trybot, tab_complex_theme_cold got an average of ~40ms better. Review URL: http://codereview.chromium.org/305001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29780 0039d316-1c4b-4281-b951-d872f2087c98
* Delete unused themes from disk on shutdown.tony@chromium.org2009-10-191-1/+23
| | | | | | | | | | | | This reduces the size of the Preferences file and frees up some disk space. The smaller Preferences file should help improve startup time for users who have installed lots of themes. BUG=24377 Review URL: http://codereview.chromium.org/303006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29468 0039d316-1c4b-4281-b951-d872f2087c98
* First fix to minimize copying of image data.erg@google.com2009-10-191-22/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first of multiple patches that clean up handling of memory regarding images. Previously, the code did several memcpy()s or equivalents. This change: - Creates an abstract interface RefCountedMemory which provides access to the front() of a memory range and the size() of it. It is a RefCountedThreadSafe. - Adds a RefCountedStaticMemory class which isa RefCountedMemory. - Pushes RefCountedBytes up into base/ from chrome/ and make it conform to RefCountedMemory. - Have ResourceBundle return RefCountedStaticMemory to the mmaped() or DLL loaded resources instead of memcpy()ing them. - General cleanups to minimize copies in constructing RefCountedBytes. - Use the above consistent interface in the BrowserThemeProvider, along with special casing the loading of the new tab page background. This patch is mostly cleanups and there should only be a slight performance gain if any. Most of the real speedups should come in subsequent patches. BUG=http://crbug.com/24493 TEST=Slightly faster on Perf bot; does not introduce crashes. Review URL: http://codereview.chromium.org/288005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29412 0039d316-1c4b-4281-b951-d872f2087c98
* Default to using system background, text, and link colors on the NTP instead ↵pkasting@chromium.org2009-10-151-0/+10
| | | | | | | | | | of white, black, and blue (respectively). BUG=22967 TEST=Change system theme, start Chrome w/no theme, observe the NTP respects the system colors. Review URL: http://codereview.chromium.org/273043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29155 0039d316-1c4b-4281-b951-d872f2087c98
* Disable "Reset to Default Theme" button in Google Chrome Options / Personal ↵mirandac@chromium.org2009-10-141-0/+7
| | | | | | | | | | | | | Stuff when the default theme is already set. This change is for the Mac OS; Windows change in a separate patch. BUG= http://crbug.com/18585 TEST= Install a default theme, note that button is disabled. Install a non-default theme, note that button is enabled. Rinse, repeat. Review URL: http://codereview.chromium.org/278004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29047 0039d316-1c4b-4281-b951-d872f2087c98
* Use predefined color names where possible for clarity. Also use ↵pkasting@chromium.org2009-10-131-10/+8
| | | | | | | | | | "SkColorSetARGB(0, 0, 0, 0)" in place of "NULL" since it's not obvious what the latter means as a color. BUG=none TEST=none Review URL: http://codereview.chromium.org/273042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28874 0039d316-1c4b-4281-b951-d872f2087c98
* Make the ThemeProvider methods const.pkasting@chromium.org2009-10-131-64/+76
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/266037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28868 0039d316-1c4b-4281-b951-d872f2087c98
* A few other miscellaneous bits of cleanup to BrowserThemeProvider:pkasting@chromium.org2009-10-131-21/+19
| | | | | | | | | | | | | * Put "&" ref-qualifier on type, not variable (style guide) * Use "foo.count(bar)" instead of "foo.find(bar) != foo.end()" where possible (shorter) * Better iterator name in one spot (missed it last time) * Some tiny indentation/whitespace/line-wrapping changes BUG=none TEST=none Review URL: http://codereview.chromium.org/275004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28827 0039d316-1c4b-4281-b951-d872f2087c98
* Misc. cleanup for theme provider code, including:pkasting@chromium.org2009-10-131-245/+213
| | | | | | | | | | | | | | | | | | | | | * Use correct indentation/alignment in a number of places * Use early-return to avoid long code block indenting * Use for() instead of while() in cases where that's what the code is actually doing * Consistent naming for iterators ("foo_iter", "bar_iter" instead of sometimes that way and sometimes "found") * Use {} when needed, don't use when not * Do not use "else" after "return" * Shorten overly-verbose code * Pull some trivial functions into the header * Eliminate unused function * Use STLDeleteValues() helper where appropriate Some of this was originally in my patch that modified constness, but I've split it out to make that more sane. BUG=none TEST=none Review URL: http://codereview.chromium.org/272033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28771 0039d316-1c4b-4281-b951-d872f2087c98
* Make function definition order (.cc) match function declaration order (.h). ↵pkasting@chromium.org2009-10-121-399/+399
| | | | | | | | | | No code changes. BUG=none TEST=none Review URL: http://codereview.chromium.org/267055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28725 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Refactor some things so GTK doesn't touch the on disk image cache.erg@google.com2009-10-051-30/+42
| | | | | | | | | | Hopefully will solve crash. BUG=23588 Review URL: http://codereview.chromium.org/258020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28066 0039d316-1c4b-4281-b951-d872f2087c98
* Move the JPEG and PNG codecs from base/gfx to app/gfx/codec. Move the classesbrettw@chromium.org2009-10-031-8/+7
| | | | | | | | | | | | | | | into the gfx namespace. Combine the PNGEncoder and PNGDecoder. There were separate when we had different executables for the browser and renderer, and linked the encoder only in one of them (which saved us some space used by libpng). This hasn't been the case for years, so combining them (again) makes sense. TEST=none BUG=none Review URL: http://codereview.chromium.org/243076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27930 0039d316-1c4b-4281-b951-d872f2087c98
* Change disk access on theme install from UI to File thread.mirandac@chromium.org2009-09-301-53/+96
| | | | | | | | | | | BUG= http://crbug.com/17696 TEST= none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=27520 Review URL: http://codereview.chromium.org/222025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27625 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 27520.mirandac@chromium.org2009-09-291-96/+53
| | | | | | Review URL: http://codereview.chromium.org/256003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27540 0039d316-1c4b-4281-b951-d872f2087c98
* Change disk access on theme install from UI to File thread.mirandac@chromium.org2009-09-291-53/+96
| | | | | | | | | BUG= http://crbug.com/17696 TEST= none Review URL: http://codereview.chromium.org/222025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27520 0039d316-1c4b-4281-b951-d872f2087c98
* Wires up views on linux dialogs to use gtk ones.sky@chromium.org2009-09-291-1/+1
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/254007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27484 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Initialize profile_ and process_images_ in the constructor.jhawkins@chromium.org2009-09-281-2/+3
| | | | | | | | | CID=3971 BUG=none TEST=none Review URL: http://codereview.chromium.org/219014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27396 0039d316-1c4b-4281-b951-d872f2087c98
* Move functions from skia/ext to app/gfx where possible: most of skia_utils.* ↵pkasting@chromium.org2009-09-241-22/+21
| | | | | | | | | | | | | and image_operations.* can be moved because they are not used by WebKit code. This also fixes the spelling of "Convolusion" to "Convolution" and updates some copyrights. This is a re-do of r26975, this time with WebKit update and some fixes to compile on Mac and Linux. BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27031 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 26975.pkasting@chromium.org2009-09-231-21/+22
| | | | | | Review URL: http://codereview.chromium.org/222011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26979 0039d316-1c4b-4281-b951-d872f2087c98
* Move functions from skia/ext to app/gfx where possible: most of skia_utils.* ↵pkasting@chromium.org2009-09-231-22/+21
| | | | | | | | | | | | and image_operations.* can be moved because they are not used by WebKit code. This also fixes the spelling of "Convolusion" to "Convolution" and updates some copyrights. BUG=none TEST=none Review URL: http://codereview.chromium.org/207059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26975 0039d316-1c4b-4281-b951-d872f2087c98
* Lands http://codereview.chromium.org/203029 for Thiago:sky@chromium.org2009-09-181-0/+1
| | | | | | | | | | | | | | | | | | [Windows] Bookmark-menu button should be themed like any other menu button. Command: $ chrome --bookmark-menu BUG=18954 TEST=open chrome/chromium with --bookmark-menu switch in the command line, apply a theme, see if the bookmark-menu is themed? Reset to default theme, see if the bookmark-menu come backs to default state. TEST=none BUG=none Review URL: http://codereview.chromium.org/208017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26563 0039d316-1c4b-4281-b951-d872f2087c98
* Check in http://codereview.chromium.org/197013/show for tfarina.mirandac@chromium.org2009-09-101-2/+1
| | | | | | Review URL: http://codereview.chromium.org/200086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25939 0039d316-1c4b-4281-b951-d872f2087c98
* Force preferences to save immediately when a theme is set, so that a browser ↵mirandac@chromium.org2009-09-101-0/+1
| | | | | | | | | | | crash does not corrupt the theme. BUG= http://crbug.com/21488 TEST= Install a theme. Force browser crash, and reopen. Note that theme images are not corrupted. Review URL: http://codereview.chromium.org/200080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25902 0039d316-1c4b-4281-b951-d872f2087c98
* Fix problem of white box appearing in themes without an NTP background image.mirandac@chromium.org2009-09-101-0/+7
| | | | | | | | | BUG= http://crbug.com/21290 TEST= Install a theme without an NTP image (greyscale). Look at NTP with bookmarkbar attached and detached. See no white box at bottom of NTP. Review URL: http://codereview.chromium.org/194066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25861 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure that inactive tab images line up correctly with frame image when ↵mirandac@chromium.org2009-09-101-6/+33
| | | | | | | | | | | themed. Also fix HasCustomImage so that it only returns true when the image is in the extension's original set, not just a generated theme for the cache. BUG= http://crbug.com/21134 TEST= install a theme with a detailed frame background. Open many tabs. Make sure the inactive tab image lines up with the frame image. Review URL: http://codereview.chromium.org/193030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25829 0039d316-1c4b-4281-b951-d872f2087c98
* Fix theme cache corruption.mirandac@chromium.org2009-09-031-29/+35
| | | | | | | | | BUG= http://crbug.com/20957 TEST= Install many themes quickly, with many windows open. Close browser and reopen. Theme should not be corrupted. Review URL: http://codereview.chromium.org/197010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25359 0039d316-1c4b-4281-b951-d872f2087c98
* NNTP: Fix link and link underline colorsarv@google.com2009-09-031-2/+25
| | | | | | | | | | | | | The fall back color for the link underline is the link color with the alpha channel set to 1/3 of the link color. BUG=20697 TEST=All links on the NTP should have different underline color. Also, try with different themes. Review URL: http://codereview.chromium.org/194004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25318 0039d316-1c4b-4281-b951-d872f2087c98
* Make theme setup a little faster by not blurring images for tab backgrounds.mirandac@chromium.org2009-09-031-5/+5
| | | | | | | | | BUG= http://crbug.com/20956 TEST= Install themes, note that tab backgrounds look good. Review URL: http://codereview.chromium.org/198003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25312 0039d316-1c4b-4281-b951-d872f2087c98
* If a preferences file references a theme which is from an old version, or ↵mirandac@chromium.org2009-08-281-2/+18
| | | | | | | | | | | whose images have failed to process correctly, drop back to the default theme. BUG= http://crbug.com/20263 TEST= Use a preferences file from an older version of Chrome that has a theme installed, and open Chrome. Observe that Chrome opens using the default theme. Review URL: http://codereview.chromium.org/175013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24830 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Fix a ton of compiler warnings."tony@chromium.org2009-08-281-2/+2
| | | | | | | | | | | This reverts commit r24792. TBR=estade Review URL: http://codereview.chromium.org/179028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24796 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a ton of compiler warnings.estade@chromium.org2009-08-281-2/+2
| | | | | | | | | | | | | | | Most of these are classes with virtual methods lacking virtual destructors or NULL used in non-pointer context. BUG=none TEST=app_unittests && base_unittests --gtest_filter=-ConditionVariableTest.LargeFastTaskTest patch by Jacob Mandelson <jlmjlm [at] gmail> http://codereview.chromium.org/171028/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24792 0039d316-1c4b-4281-b951-d872f2087c98
* Fix theme caching on Vista 64 when default theme is installed from the theme ↵mirandac@chromium.org2009-08-281-6/+15
| | | | | | | | | | | gallery. BUG= http://crbug.com/20344 TEST= On vista 64 , install a non-default theme. Open theme gallery and choose "Classic" theme. Close browser and restart. Theme should be default aero theme on Vista, and not the opaque blue windows theme. Review URL: http://codereview.chromium.org/174562 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24709 0039d316-1c4b-4281-b951-d872f2087c98
* Add call to BrowserThemeProvider::GenerateBitmap removed in r24170.erg@google.com2009-08-271-0/+5
| | | | | | | | | | (Linux relies on the lazy generation provided by GenerateBitmap; having to call GenerateTabImages() regressed linux startup; theoretically it'd be nice if everything was done lazily...) Review URL: http://codereview.chromium.org/180004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24643 0039d316-1c4b-4281-b951-d872f2087c98
* Add single line of tips to NNTP.mirandac@chromium.org2009-08-261-1/+1
| | | | | | | | | BUG= http://crbug.com/19162 TEST= Start browser with NNTP, note line of tips at bottom. Review URL: http://codereview.chromium.org/173087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24384 0039d316-1c4b-4281-b951-d872f2087c98
* - Fix bug where white logo wasn't showingglen@chromium.org2009-08-251-6/+6
| | | | | | | | | | | - Add attribution support back to the NTP BUG=20019 TEST=Install a theme with a white logo and attribution, and verify that both display correctly. Review URL: http://codereview.chromium.org/173372 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24323 0039d316-1c4b-4281-b951-d872f2087c98
* Cache images on theme install so startup does no image processing.mirandac@chromium.org2009-08-241-52/+167
| | | | | | | | | BUG= http://crbug.com/18768 TEST= none Review URL: http://codereview.chromium.org/174085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24170 0039d316-1c4b-4281-b951-d872f2087c98
* With the recent NNTP changes, we change the way themes work - they're now ↵glen@chromium.org2009-08-111-6/+24
| | | | | | | | | | | | | closer to NTP1 theming - ntp_section_* is used to control the display of the light blue sections, and we've added ntp_header that controls the dark blue hover color, ntp_header falls back to ntp_section if provided. Also fix a minor bug where the default theme was saving theme data - we were generating colors before saving the provided colors. BUG=18720,18722 TEST=Install a theme and verify that the recently closed section is themed correctly. Review URL: http://codereview.chromium.org/165192 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23081 0039d316-1c4b-4281-b951-d872f2087c98
* Allow theming of colors for the Mac.avi@chromium.org2009-08-111-30/+68
| | | | | | | | | BUG=http://crbug.com/18438 TEST=none Review URL: http://codereview.chromium.org/162010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23023 0039d316-1c4b-4281-b951-d872f2087c98
* GTK Theme: Use Glen's new non-bordererg@google.com2009-08-081-4/+6
| | | | | | | | | | | | Imports Glen's new icons, and creates centered versions of all of them. Then use these icons in the GTK theme interface. Also selects the button tinting color to be a lighter color on some very dark backgrounds. Review URL: http://codereview.chromium.org/164202 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22839 0039d316-1c4b-4281-b951-d872f2087c98
* Quick 'low-risk-for-the-next-release' fix to increase theme install/load ↵glen@chromium.org2009-08-051-1/+1
| | | | | | | | | | | perf (should be a 2-4x speedup). Bug should remain open until a better approach (background threads, perhaps) is used. BUG=17696 TEST=none Review URL: http://codereview.chromium.org/159903 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22487 0039d316-1c4b-4281-b951-d872f2087c98
* Make the DOMUIThemeSource load and pass through a PNG, rather than relying ↵glen@chromium.org2009-08-051-0/+18
| | | | | | | | | | | on decode/encode. BUG=18427 TEST=Install a giant theme, load the NNTP, verify that you can type in the omnibox without delay while the page is loading. Review URL: http://codereview.chromium.org/159891 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22457 0039d316-1c4b-4281-b951-d872f2087c98