From abe92999c62ebc866b8a0451b3a1eb1d71e37391 Mon Sep 17 00:00:00 2001
From: "sail@chromium.org"
 <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Tue, 19 Apr 2011 23:18:22 +0000
Subject: 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.

Review URL: http://codereview.chromium.org/6849030

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82185 0039d316-1c4b-4281-b951-d872f2087c98
---
 chrome/browser/resources_util.cc | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'chrome/browser/resources_util.cc')

diff --git a/chrome/browser/resources_util.cc b/chrome/browser/resources_util.cc
index ab2fe9d..99a2743 100644
--- a/chrome/browser/resources_util.cc
+++ b/chrome/browser/resources_util.cc
@@ -9,6 +9,7 @@
 #include "base/hash_tables.h"
 #include "base/lazy_instance.h"
 #include "grit/theme_resources_map.h"
+#include "grit/theme_resources_standard_map.h"
 
 namespace {
 
@@ -23,6 +24,10 @@ class ThemeMap {
     for (size_t i = 0; i < kThemeResourcesSize; ++i) {
       id_map_[kThemeResources[i].name] = kThemeResources[i].value;
     }
+    for (size_t i = 0; i < kThemeResourcesStandardSize; ++i) {
+      id_map_[kThemeResourcesStandard[i].name] =
+          kThemeResourcesStandard[i].value;
+    }
   }
 
   int GetId(const std::string& resource_name) {
-- 
cgit v1.1