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

Issue 6849030: Add support for multi resolution icons (Closed)

Created:
9 years, 8 months ago by sail
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Add support for multi resolution icons To support HiDPI we need a way to load two copies of icons, a low resolution version and a high resolution version. To support this, this change does the following: - split theme_resource.grd into three files: - theme_resources.grd: icons that only have one resolution - theme_resources_standard.grd: low resolution icons - theme_resources_large.grd: high resolution icons - theme_resource.grd and theme_resources_standard.grd and compiled into chrome.pak/chrome.rc for all platforms. - theme_resources_large.grd is compiled into theme_resources_large.pak for platforms that want high resolution icons (currently only Mac) - gfx::Image now support icons with multiple resolution Currently not all ThemeService APIs return multi-resolution images. Once this is checked in I'll work on converting them as I go. Note, this change will have to be coordinated with the change to reorganize theme resources. I'll work with saintlou on that. BUG=75812 TEST=Added a TIFF to theme_resources.grd. Verified that the toolbar icon had a mutliresolution image. Verified that unit tests passed. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82185

Patch Set 1 #

Total comments: 12

Patch Set 2 : Changed to PNG #

Patch Set 3 : Fixed touchui #

Total comments: 11

Patch Set 4 : Fixed build errors/Addressed review comments #

Patch Set 5 : Fixed try bots #

Patch Set 6 : Fixed try bots #

Patch Set 7 : Fix try jobs #

Patch Set 8 : Fix try jobs #

Total comments: 10

Patch Set 9 : Added unit test for gfx::Image #

Total comments: 6

Patch Set 10 : Fixed linux try bots #

Patch Set 11 : Address review comments #

Patch Set 12 : Fixed resource ID conflict with devtools #

Total comments: 9

Patch Set 13 : Removed inline #

Patch Set 14 : fix header #

Total comments: 1

Patch Set 15 : Added files #

Total comments: 2

Patch Set 16 : Added header #

Total comments: 2

Patch Set 17 : Added comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+868 lines, -396 lines) Patch
M chrome/app/theme/theme_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 chunks +0 lines, -248 lines 0 comments Download
A chrome/app/theme/theme_resources_large.grd View 1 2 1 chunk +113 lines, -0 lines 0 comments Download
A chrome/app/theme/theme_resources_standard.grd View 1 2 1 chunk +113 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit_view_mac.mm View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/content_setting_image_model.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/resources_util.cc View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/resources_util_unittest.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/themes/browser_theme_pack.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/themes/browser_theme_pack_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/themes/theme_service.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/themes/theme_service_mac.mm View 1 2 3 2 chunks +12 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/background_gradient_view.mm View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_frame_view.mm View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_view.mm View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/hover_image_button_unittest.mm View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/star_decoration.mm View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/tabs/tab_view.mm View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/back_forward_button_gtk.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_titlebar.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_toolbar_gtk.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/gtk_theme_service.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/gtk_util.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/location_bar_view_gtk.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/notifications/balloon_view_gtk.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/reload_button_gtk.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/tests/ui_gfx_image_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/tests/ui_gfx_image_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/touch/tabs/touch_tab.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/browser_actions_container.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/bubble/bubble_border.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/constrained_window_views.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/detachable_toolbar_view.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/find_bar_view.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/glass_browser_frame_view.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/opaque_browser_frame_view.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/location_bar/star_view.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/notifications/balloon_view.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/tabs/base_tab.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab_strip.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/theme_background.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/toolbar_view.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/webui/theme_source_unittest.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +41 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/chrome_common.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_dll.gypi View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +20 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 15 chunks +16 lines, -0 lines 0 comments Download
M skia/ext/skia_utils_mac.h View 1 4 chunks +10 lines, -0 lines 0 comments Download
M skia/ext/skia_utils_mac.mm View 1 2 3 4 5 6 7 8 5 chunks +46 lines, -13 lines 0 comments Download
M skia/ext/skia_utils_mac_unittest.mm View 1 2 3 4 3 chunks +120 lines, -23 lines 0 comments Download
M tools/grit/grit/format/resource_map.py View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M tools/grit/resource_ids View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -1 line 0 comments Download
M ui/base/resource/resource_bundle.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M ui/base/resource/resource_bundle.cc View 1 2 3 4 5 6 7 3 chunks +11 lines, -1 line 0 comments Download
M ui/base/resource/resource_bundle_linux.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M ui/base/resource/resource_bundle_mac.mm View 1 2 3 4 2 chunks +20 lines, -0 lines 0 comments Download
M ui/base/resource/resource_bundle_posix.cc View 1 1 chunk +8 lines, -0 lines 0 comments Download
M ui/gfx/image.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +19 lines, -0 lines 0 comments Download
M ui/gfx/image.cc View 1 2 3 4 5 6 7 8 7 chunks +35 lines, -10 lines 0 comments Download
M ui/gfx/image_mac.mm View 1 2 3 1 chunk +10 lines, -2 lines 0 comments Download
A ui/gfx/image_mac_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +114 lines, -0 lines 0 comments Download
M ui/gfx/image_unittest.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -67 lines 0 comments Download
M ui/gfx/image_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +40 lines, -5 lines 0 comments Download
A ui/gfx/image_unittest_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +33 lines, -0 lines 0 comments Download
A + ui/gfx/image_unittest_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +4 lines, -16 lines 0 comments Download
M ui/ui_unittests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 37 (0 generated)
sail
Once this is checked in my next step is to move various icons over to ...
9 years, 8 months ago (2011-04-14 18:13:58 UTC) #1
Nico
+tony, who has experience with the resource bundle stuff as far as I know. Mention ...
9 years, 8 months ago (2011-04-14 18:28:54 UTC) #2
Elliot Glaysher
I'm really uncomfortable with this approach (or at least this timing). This touches a lot ...
9 years, 8 months ago (2011-04-14 18:33:41 UTC) #3
Robert Sesek
I really don't like the nested vector of bitmaps for all images... Does NSImage decode ...
9 years, 8 months ago (2011-04-14 18:42:44 UTC) #4
tony
Here's another idea: Make it possible in grd files to have a png resource marked ...
9 years, 8 months ago (2011-04-14 18:46:45 UTC) #5
Emmanuel Saint-loubert-Bié
I have no opinion on Tiff vs other format. However I believe that it is ...
9 years, 8 months ago (2011-04-14 18:48:52 UTC) #6
sail
Thanks for the feedback everyone. I'm going to work on implementing Tony's suggestion. The basic ...
9 years, 8 months ago (2011-04-14 19:52:48 UTC) #7
sail
* switched to PNG * get rid of std::vector<SkBitmap*> and push it into gfx:Image * ...
9 years, 8 months ago (2011-04-15 00:47:47 UTC) #8
sail
9 years, 8 months ago (2011-04-15 03:04:47 UTC) #9
Emmanuel Saint-loubert-Bié
This CL looks good for Touch. I will therefore close and not submit my deeper ...
9 years, 8 months ago (2011-04-15 14:35:16 UTC) #10
Elliot Glaysher
1) I like how your no longer passing vector<SkBitmap*> around in cross platform code. That ...
9 years, 8 months ago (2011-04-15 18:05:49 UTC) #11
sail
On 2011/04/15 18:05:49, Elliot Glaysher wrote: > 1) I like how your no longer passing ...
9 years, 8 months ago (2011-04-15 18:11:51 UTC) #12
Robert Sesek
http://codereview.chromium.org/6849030/diff/9001/chrome/browser/themes/theme_service_mac.mm File chrome/browser/themes/theme_service_mac.mm (right): http://codereview.chromium.org/6849030/diff/9001/chrome/browser/themes/theme_service_mac.mm#newcode57 chrome/browser/themes/theme_service_mac.mm:57: nsimage = static_cast<NSImage*>(rb_.GetNativeImageNamed(id)); You can probably get away without ...
9 years, 8 months ago (2011-04-15 20:27:20 UTC) #13
sail
http://codereview.chromium.org/6849030/diff/9001/chrome/browser/themes/theme_service_mac.mm File chrome/browser/themes/theme_service_mac.mm (right): http://codereview.chromium.org/6849030/diff/9001/chrome/browser/themes/theme_service_mac.mm#newcode57 chrome/browser/themes/theme_service_mac.mm:57: nsimage = static_cast<NSImage*>(rb_.GetNativeImageNamed(id)); On 2011/04/15 20:27:20, rsesek wrote: > ...
9 years, 8 months ago (2011-04-16 01:24:59 UTC) #14
sail
9 years, 8 months ago (2011-04-16 23:33:28 UTC) #15
sail
rsesek: Are you ok with this change. Should I go ahead and check it in?
9 years, 8 months ago (2011-04-18 21:43:40 UTC) #16
Emmanuel Saint-loubert-Bié
Given the nature of your change I would recommend you launch a "linux_touch" try-bot. Also ...
9 years, 8 months ago (2011-04-18 21:48:35 UTC) #17
Robert Sesek
No, sorry, I'm still not quite happy (yes, I'm a curmudgeon) -- I'll send feedback ...
9 years, 8 months ago (2011-04-18 22:00:39 UTC) #18
Robert Sesek
http://codereview.chromium.org/6849030/diff/16134/skia/ext/skia_utils_mac.mm File skia/ext/skia_utils_mac.mm (right): http://codereview.chromium.org/6849030/diff/16134/skia/ext/skia_utils_mac.mm#newcode201 skia/ext/skia_utils_mac.mm:201: base::mac::ScopedCFTypeRef<CGColorSpaceRef> colorSpace( nit: use under_scores in C++, so this ...
9 years, 8 months ago (2011-04-18 22:48:13 UTC) #19
Nico
http://codereview.chromium.org/6849030/diff/16134/ui/gfx/image.h File ui/gfx/image.h (right): http://codereview.chromium.org/6849030/diff/16134/ui/gfx/image.h#newcode54 ui/gfx/image.h:54: // TODO Add support for multiple resolutions when necessary. ...
9 years, 8 months ago (2011-04-18 22:51:35 UTC) #20
sail
http://codereview.chromium.org/6849030/diff/16134/skia/ext/skia_utils_mac.mm File skia/ext/skia_utils_mac.mm (right): http://codereview.chromium.org/6849030/diff/16134/skia/ext/skia_utils_mac.mm#newcode201 skia/ext/skia_utils_mac.mm:201: base::mac::ScopedCFTypeRef<CGColorSpaceRef> colorSpace( On 2011/04/18 22:48:13, rsesek wrote: > nit: ...
9 years, 8 months ago (2011-04-19 00:21:53 UTC) #21
sail
9 years, 8 months ago (2011-04-19 01:03:33 UTC) #22
Robert Sesek
I'm mostly placated -- thanks :). Just a few nits. http://codereview.chromium.org/6849030/diff/13002/ui/gfx/image_mac_unittest.mm File ui/gfx/image_mac_unittest.mm (right): http://codereview.chromium.org/6849030/diff/13002/ui/gfx/image_mac_unittest.mm#newcode30 ...
9 years, 8 months ago (2011-04-19 02:41:41 UTC) #23
sail
http://codereview.chromium.org/6849030/diff/13002/ui/gfx/image_mac_unittest.mm File ui/gfx/image_mac_unittest.mm (right): http://codereview.chromium.org/6849030/diff/13002/ui/gfx/image_mac_unittest.mm#newcode30 ui/gfx/image_mac_unittest.mm:30: CHECK([[[image representations] lastObject] On 2011/04/19 02:41:41, rsesek wrote: > ...
9 years, 8 months ago (2011-04-19 04:56:59 UTC) #24
sail
9 years, 8 months ago (2011-04-19 06:58:51 UTC) #25
Elliot Glaysher
Please out of line the functions into a CC file then. On Apr 18, 2011 ...
9 years, 8 months ago (2011-04-19 16:22:56 UTC) #26
Robert Sesek
http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm File ui/gfx/image_mac_unittest.mm (right): http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm#newcode23 ui/gfx/image_mac_unittest.mm:23: void CreateBitmapImageRep(int width, int height, NSImageRep** image_rep) { nit: ...
9 years, 8 months ago (2011-04-19 17:40:09 UTC) #27
sail
On 2011/04/19 16:22:56, Elliot Glaysher wrote: > Please out of line the functions into a ...
9 years, 8 months ago (2011-04-19 20:15:13 UTC) #28
sail
http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm File ui/gfx/image_mac_unittest.mm (right): http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm#newcode23 ui/gfx/image_mac_unittest.mm:23: void CreateBitmapImageRep(int width, int height, NSImageRep** image_rep) { On ...
9 years, 8 months ago (2011-04-19 20:15:18 UTC) #29
sail
9 years, 8 months ago (2011-04-19 20:18:04 UTC) #30
sail
9 years, 8 months ago (2011-04-19 20:22:09 UTC) #31
Robert Sesek
http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm File ui/gfx/image_mac_unittest.mm (right): http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm#newcode66 ui/gfx/image_mac_unittest.mm:66: } else { On 2011/04/19 20:15:19, sail wrote: > ...
9 years, 8 months ago (2011-04-19 20:53:18 UTC) #32
sail
http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm File ui/gfx/image_mac_unittest.mm (right): http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm#newcode66 ui/gfx/image_mac_unittest.mm:66: } else { On 2011/04/19 20:53:18, rsesek wrote: > ...
9 years, 8 months ago (2011-04-19 21:07:07 UTC) #33
Robert Sesek
LGTM! Thanks for sticking with it :). http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm File ui/gfx/image_mac_unittest.mm (right): http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm#newcode66 ui/gfx/image_mac_unittest.mm:66: } else ...
9 years, 8 months ago (2011-04-19 21:12:56 UTC) #34
sail
http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm File ui/gfx/image_mac_unittest.mm (right): http://codereview.chromium.org/6849030/diff/21089/ui/gfx/image_mac_unittest.mm#newcode66 ui/gfx/image_mac_unittest.mm:66: } else { On 2011/04/19 21:12:56, rsesek wrote: > ...
9 years, 8 months ago (2011-04-19 21:27:26 UTC) #35
Robert Sesek
LGTM
9 years, 8 months ago (2011-04-19 21:30:05 UTC) #36
sail
9 years, 8 months ago (2011-04-19 21:30:40 UTC) #37

          

Powered by Google App Engine
This is Rietveld 408576698