From 0664c0aac6a1c9c3c8d5039eb6c667a99e3bc18a Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Fri, 24 Jul 2009 00:03:54 +0000 Subject: Enable SVG icons for linux. get rid of kEnableSVG BUG=12272 TEST=I made it load an svg for the download shelf and it worked. SVGZ did not work. Review URL: http://codereview.chromium.org/159247 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21481 0039d316-1c4b-4281-b951-d872f2087c98 --- base/mime_util_linux.cc | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'base') diff --git a/base/mime_util_linux.cc b/base/mime_util_linux.cc index 43e5a2d..c5fe60c 100644 --- a/base/mime_util_linux.cc +++ b/base/mime_util_linux.cc @@ -22,9 +22,6 @@ namespace { -// Toggles whether we can handle SVG icons. See http://crbug.com/12272 -const bool kEnableSVG = false; - class IconTheme; class MimeUtilConstants { @@ -37,7 +34,7 @@ class MimeUtilConstants { std::map* icon_dirs_; // Store icon formats. - std::vector* icon_formats_; + std::vector icon_formats_; // Store loaded icon_theme. std::map* icon_themes_; @@ -53,9 +50,12 @@ class MimeUtilConstants { MimeUtilConstants() : kUpdateInterval(5), icon_dirs_(NULL), - icon_formats_(NULL), icon_themes_(NULL), last_check_time_(0) { + icon_formats_.push_back(".png"); + icon_formats_.push_back(".svg"); + icon_formats_.push_back(".xpm"); + for (size_t i = 0; i < kDefaultThemeNum; ++i) default_themes_[i] = NULL; } @@ -227,7 +227,7 @@ FilePath IconTheme::GetIconPathUnderSubdir(const std::string& icon_name, FilePath icon_path; std::list::iterator dir_iter; std::vector* icon_formats = - Singleton::get()->icon_formats_; + &Singleton::get()->icon_formats_; for (dir_iter = dirs_.begin(); dir_iter != dirs_.end(); ++dir_iter) { for (size_t i = 0; i < icon_formats->size(); ++i) { icon_path = dir_iter->Append(subdir); @@ -386,19 +386,6 @@ void AddXDGDataDir(const FilePath& dir) { TryAddIconDir(dir.Append("pixmaps")); } -// Enable or disable SVG support. -void EnableSvgIcon(bool enable) { - std::vector* icon_formats = - Singleton::get()->icon_formats_; - icon_formats->clear(); - icon_formats->push_back(".png"); - if (enable) { - icon_formats->push_back(".svg"); - icon_formats->push_back(".svgz"); - } - icon_formats->push_back(".xpm"); -} - // Add all the xdg icon directories. void InitIconDir() { Singleton::get()->icon_dirs_->clear(); @@ -445,8 +432,6 @@ void EnsureUpdated() { if (constants->last_check_time_ == 0) { constants->icon_dirs_ = new std::map; constants->icon_themes_ = new std::map; - constants->icon_formats_ = new std::vector; - EnableSvgIcon(kEnableSVG); InitIconDir(); constants->last_check_time_ = now; } else { @@ -463,7 +448,7 @@ FilePath LookupFallbackIcon(const std::string& icon_name) { MimeUtilConstants* constants = Singleton::get(); std::map::iterator iter; std::map* icon_dirs = constants->icon_dirs_; - std::vector* icon_formats = constants->icon_formats_; + std::vector* icon_formats = &constants->icon_formats_; for (iter = icon_dirs->begin(); iter != icon_dirs->end(); ++iter) { for (size_t i = 0; i < icon_formats->size(); ++i) { icon = iter->first.Append(icon_name + (*icon_formats)[i]); @@ -548,7 +533,6 @@ FilePath LookupIconInDefaultTheme(const std::string& icon_name, int size) { MimeUtilConstants::~MimeUtilConstants() { delete icon_dirs_; - delete icon_formats_; delete icon_themes_; for (size_t i = 0; i < kDefaultThemeNum; i++) delete default_themes_[i]; -- cgit v1.1