summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_theme_provider.h
Commit message (Collapse)AuthorAgeFilesLines
* Delete unused themes from disk on shutdown.tony@chromium.org2009-10-191-0/+3
| | | | | | | | | | | | 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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make the ThemeProvider methods const.pkasting@chromium.org2009-10-131-40/+40
| | | | | | | | 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-2/+2
| | | | | | | | | | | | | * 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-2/+2
| | | | | | | | | | | | | | | | | | | | | * 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
* GTK: Refactor some things so GTK doesn't touch the on disk image cache.erg@google.com2009-10-051-0/+5
| | | | | | | | | | 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
* Change disk access on theme install from UI to File thread.mirandac@chromium.org2009-09-301-8/+25
| | | | | | | | | | | 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-25/+8
| | | | | | 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-8/+25
| | | | | | | | | 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-3/+3
| | | | | | | | 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-1/+1
| | | | | | | | | 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
* Convert the BrowerThemeProvider pointer from being ref counted totony@chromium.org2009-09-251-2/+1
| | | | | | | | | not being ref counted. It's owned by the profile and it doesn't need to be ref counted. Review URL: http://codereview.chromium.org/223027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27152 0039d316-1c4b-4281-b951-d872f2087c98
* Move functions from skia/ext to app/gfx where possible: most of skia_utils.* ↵pkasting@chromium.org2009-09-241-11/+11
| | | | | | | | | | | | | 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-11/+11
| | | | | | 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-11/+11
| | | | | | | | | | | | 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
* Reapplies the GdkPixbuf -> cairo surface patch.erg@google.com2009-09-101-4/+4
| | | | | | | | | | | | | Only difference is explicitly calling a FreePerDisplaySurfaces() function from ~GtkThemeProvider() because vtables are set to base class during destructor calling. BUG=http://crbug.com/10499 Original Review URL: http://codereview.chromium.org/197046 Review URL: http://codereview.chromium.org/199077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25880 0039d316-1c4b-4281-b951-d872f2087c98
* http://src.chromium.org/viewvc/chrome?view=rev&revision=25829 should have ↵mirandac@chromium.org2009-09-101-1/+1
| | | | | | | | | | | | | included this change to the signature of the SaveThemeBitmap method. BUG= none TEST= none TBR: glen Review URL: http://codereview.chromium.org/196073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25837 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Upload GdkPixbufs into cairo surfaces so they (hopefully) live on the Xerg@google.com2009-09-101-4/+4
| | | | | | | | | | | | | server and have better performance. In the presence of XRender, let cairo do things smarter." Valgrind problems. This reverts commit 03871714c3e5b39ee0f8369ecc2313c02fe0ca08 (r25814). Review URL: http://codereview.chromium.org/200071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25828 0039d316-1c4b-4281-b951-d872f2087c98
* Upload GdkPixbufs into cairo surfaces so they (hopefully) live on the X ↵erg@google.com2009-09-091-4/+4
| | | | | | | | | | | | | | server and have better performance. In the presence of XRender, let cairo do things smarter. This is a big win performance wise. BrowserWindowGtk::OnCustomFrameExpose, a heavy user of images sped up from an average runtime of 20.5ms to 0.7ms. TEST=Run through valgrind, don't leak memory. TEST=Run both before and after using xtrace. Notice fewer XCreatePixmap requests and more XRender-CreatePicture requests. BUG=http://crbug.com/10499 Review URL: http://codereview.chromium.org/197046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25814 0039d316-1c4b-4281-b951-d872f2087c98
* Fix theme cache corruption.mirandac@chromium.org2009-09-031-5/+7
| | | | | | | | | 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-0/+4
| | | | | | | | | | | | | 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
* Fix theme caching on Vista 64 when default theme is installed from the theme ↵mirandac@chromium.org2009-08-281-0/+3
| | | | | | | | | | | 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
* GTK Themes: Create an inactive tab text color based on the inactive tab.erg@google.com2009-08-251-3/+3
| | | | | | | | | (We were previously just grabbing a raw GTK color, which didn't work out very well in themes like High Contrast Inverse...) Review URL: http://codereview.chromium.org/174407 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24316 0039d316-1c4b-4281-b951-d872f2087c98
* GTK Themes: Fix linux UI frame regression introduced in r24170.erg@google.com2009-08-251-0/+4
| | | | | | Review URL: http://codereview.chromium.org/173389 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24310 0039d316-1c4b-4281-b951-d872f2087c98
* Cache images on theme install so startup does no image processing.mirandac@chromium.org2009-08-241-1/+23
| | | | | | | | | 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-0/+3
| | | | | | | | | | | | | 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-2/+7
| | | | | | | | | 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
* Make the DOMUIThemeSource load and pass through a PNG, rather than relying ↵glen@chromium.org2009-08-051-4/+7
| | | | | | | | | | | 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
* Implement kCurrentThemeID so we can know what the last theme to be installed ↵avi@chromium.org2009-08-031-0/+9
| | | | | | | | | | | was. BUG=none TEST=not visible in UI Review URL: http://codereview.chromium.org/159705 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22270 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a bunch of bugs related to NNTP theming.glen@chromium.org2009-07-241-1/+7
| | | | | | | | | | | | | | | | | | Basically: - Add NNTP Theming BrowserThemeProvider: - Add NNTP logo inversion capability - Only allow a set of images to be themed. - Tint incognito windows correctly. (Sorry for the feature-mush) BUG=17379,14578,17593 TEST=Make sure the NNTP is themed correctly. Review URL: http://codereview.chromium.org/159305 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21509 0039d316-1c4b-4281-b951-d872f2087c98
* Fix native GTK interface.erg@chromium.org2009-07-191-2/+1
| | | | | | | | | | | In r21039, BrowserThemeProvider::Init was made non-virtual, which meant that GtkBrowserThemeProvider::Init was never being called. Make it virtual again (so the linux UI renders properly), and explicitly add Init() to the ThemeProvider interface so this doesn't happen again. Review URL: http://codereview.chromium.org/155754 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21066 0039d316-1c4b-4281-b951-d872f2087c98
* Allow the tiling of theme background images on the NTP.mirandac@chromium.org2009-07-181-2/+25
| | | | | | | | | BUG= http://crbug/com/15796 TEST= Add a property for tiling to a theme manifest.json. Observe that the theme image is tiled on the NTP. Review URL: http://codereview.chromium.org/149741 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21039 0039d316-1c4b-4281-b951-d872f2087c98
* Restore RTL icons to CustomDrawButtonBase.tc@google.com2009-07-131-0/+6
| | | | | | | | | | Since moving from ResourceBundle to ThemeProvider, we needed to plumb through GetRTLEnabledPixbufNamed in ThemeProvider. Review URL: http://codereview.chromium.org/149483 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20568 0039d316-1c4b-4281-b951-d872f2087c98
* GTK Themes: Refactored to use notifications instead of manual plumbing.erg@google.com2009-07-131-67/+67
| | | | | | | | | | | | - Removes large amounts of plumbing because: - All GtkChromeButtons are constructed from GtkThemeProvider which keeps a reference to all live buttons and sends them theme change notifications. - CustomDrawButtons now subscribe themselves to the BROWSER_THEME_CHANGED notification; this gets rid of a LOT of plubming. - Removes the GtkThemeProperties struct; just pass the theme provider around. - Move all the constants from the themes namespace to class statics, per tony's suggestion Review URL: http://codereview.chromium.org/149547 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20561 0039d316-1c4b-4281-b951-d872f2087c98
* GTK: Initial implementation of using GTK themes, partially based on evan's ↵erg@google.com2009-07-031-19/+100
| | | | | | | | | | | | | | | | | | | | | | | CL 118358. A lot of stuff works: - Colors are picked out of the GTK theme. - Buttons use the current GTK button theme. - We use the user's icon theme. A lot of stuff doesn't: - We could do a better job of picking colors for the skylines. - The omnibox hasn't been touched. - UI that's not part of the toolbar hasn't been touched. - We currently fail on themes like HighContrastInverse. TEST=Under Options>Personal Stuff, click GTK Theme. Colors and widgets should be rendered with the current GTK theme stuff. TEST=With chrome open and in GTK Theme mode, change your GTK theme or icon theme. chrome should pick up on the change immediately and reimport the colors and images. http://crbug.com/13967 Review URL: http://codereview.chromium.org/150176 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19868 0039d316-1c4b-4281-b951-d872f2087c98
* Allow getting the theme tint as a value so that it can be applied ↵avi@chromium.org2009-07-011-4/+13
| | | | | | | | | | | independent of the theme provider. Since the Mac needs it to tint its vector resources it's added to the Mac. BUG=none TEST=none Review URL: http://codereview.chromium.org/151153 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19751 0039d316-1c4b-4281-b951-d872f2087c98
* Take 2 at fixing BrowserThemeProvider memory leaks.tc@google.com2009-06-301-5/+2
| | | | | | | | | This time, don't delete images in generated_images_ since we're now going to delete them in image_cache_. Review URL: http://codereview.chromium.org/151048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19601 0039d316-1c4b-4281-b951-d872f2087c98
* Theme image support for the Mac.avi@chromium.org2009-06-221-6/+15
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/140007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18925 0039d316-1c4b-4281-b951-d872f2087c98
* More theme bits for the NTP and window frame.glen@chromium.org2009-06-051-0/+3
| | | | | | | | | BUG=12768,13352 TEST=Verify that a theme with attribution works on the NTP and a theme with an overlay shows up Review URL: http://codereview.chromium.org/119227 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17773 0039d316-1c4b-4281-b951-d872f2087c98
* Add ability to theme our buttons.glen@chromium.org2009-06-041-0/+4
| | | | | | | | | BUG=12762 TEST=Verify that buttons can be themed. Review URL: http://codereview.chromium.org/119025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17586 0039d316-1c4b-4281-b951-d872f2087c98
* Allow themes to change the background of the new tab page. Adds support for ↵glen@chromium.org2009-06-021-1/+29
| | | | | | | | | | | display properties to themes (stored internally as ints/enums, but parsed from text). BUG=12768 TEST=Install a theme with an new tab page background and verify that the background appears on the new tab page. Review URL: http://codereview.chromium.org/115910 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17431 0039d316-1c4b-4281-b951-d872f2087c98
* Use the right frame type on startup, do proper swapping of frames when ↵glen@chromium.org2009-05-311-0/+1
| | | | | | | | | | | themes change. Leave the native frame decision up to the ThemeProvider. BUG=12890 TEST=In Aero, unstall a theme, reset to default, install again, restart, reset theme to default. Make sure that the Aero frame changes to the themed frame and back again appropriately. Review URL: http://codereview.chromium.org/118053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17301 0039d316-1c4b-4281-b951-d872f2087c98
* Add GetPixbufNamed to ThemeProvider. GetPixbufNamed converts a loaded theme ↵jhawkins@chromium.org2009-05-201-0/+12
| | | | | | | | bitmap to a GdkPixbuf and caches the image so ThemeProvider users don't need to release them ala ResourceBundle::GetPixbufNamed. Review URL: http://codereview.chromium.org/113626 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16520 0039d316-1c4b-4281-b951-d872f2087c98
* Track and free generated images in the browser theme provider.jhawkins@chromium.org2009-05-181-7/+17
| | | | | | Review URL: http://codereview.chromium.org/115478 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16311 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land of earlier NTP theme patch; now with mac and linux compatibility.glen@chromium.org2009-05-151-1/+3
| | | | | | Review URL: http://codereview.chromium.org/115413 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16205 0039d316-1c4b-4281-b951-d872f2087c98
* Undo 16020glen@chromium.org2009-05-141-3/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16021 0039d316-1c4b-4281-b951-d872f2087c98
* Allow the new tab page to be themed (you may want to review DOMUIThemeSource ↵glen@chromium.org2009-05-141-1/+3
| | | | | | | | | | | | | as a whole and not just these changes). Change global std::strings to chars* in browser theme provider. Add ability for ReplaceStringPlaceHolder to take up to 9 replacements. BUG=11235,11685 Review URL: http://codereview.chromium.org/115172 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16020 0039d316-1c4b-4281-b951-d872f2087c98
* This is the first pass at themes.glen@chromium.org2009-05-091-0/+125
This CL is paired with http://codereview.chromium.org/67284 This CL (for commit purposes) includes http://codereview.chromium.org/67284 BUG=4463,11232,11233,11234,11235 Review URL: http://codereview.chromium.org/99030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15704 0039d316-1c4b-4281-b951-d872f2087c98