Commit 64bd0217 authored by isherman@chromium.org's avatar isherman@chromium.org

Load the default favicon as a native image, rather than as a Skia image.

This silences a line of log spew that's generated on every launch of a local
debug build.

BUG=none
TEST=less log spew
R=rsesek@chromium.org
TBR=jam@chromium.org

Review URL: https://codereview.chromium.org/333493002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276787 0039d316-1c4b-4281-b951-d872f2087c98
parent 685c0a02
...@@ -252,7 +252,7 @@ std::string AwContentBrowserClient::GetAcceptLangs( ...@@ -252,7 +252,7 @@ std::string AwContentBrowserClient::GetAcceptLangs(
return GetAcceptLangsImpl(); return GetAcceptLangsImpl();
} }
gfx::ImageSkia* AwContentBrowserClient::GetDefaultFavicon() { const gfx::ImageSkia* AwContentBrowserClient::GetDefaultFavicon() {
ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ResourceBundle& rb = ResourceBundle::GetSharedInstance();
// TODO(boliu): Bundle our own default favicon? // TODO(boliu): Bundle our own default favicon?
return rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON); return rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
......
...@@ -57,7 +57,7 @@ class AwContentBrowserClient : public content::ContentBrowserClient { ...@@ -57,7 +57,7 @@ class AwContentBrowserClient : public content::ContentBrowserClient {
int child_process_id) OVERRIDE; int child_process_id) OVERRIDE;
virtual std::string GetApplicationLocale() OVERRIDE; virtual std::string GetApplicationLocale() OVERRIDE;
virtual std::string GetAcceptLangs(content::BrowserContext* context) OVERRIDE; virtual std::string GetAcceptLangs(content::BrowserContext* context) OVERRIDE;
virtual gfx::ImageSkia* GetDefaultFavicon() OVERRIDE; virtual const gfx::ImageSkia* GetDefaultFavicon() OVERRIDE;
virtual bool AllowAppCache(const GURL& manifest_url, virtual bool AllowAppCache(const GURL& manifest_url,
const GURL& first_party, const GURL& first_party,
content::ResourceContext* context) OVERRIDE; content::ResourceContext* context) OVERRIDE;
......
...@@ -883,12 +883,12 @@ CookiesTreeModel::~CookiesTreeModel() { ...@@ -883,12 +883,12 @@ CookiesTreeModel::~CookiesTreeModel() {
// Returns the set of icons for the nodes in the tree. You only need override // Returns the set of icons for the nodes in the tree. You only need override
// this if you don't want to use the default folder icons. // this if you don't want to use the default folder icons.
void CookiesTreeModel::GetIcons(std::vector<gfx::ImageSkia>* icons) { void CookiesTreeModel::GetIcons(std::vector<gfx::ImageSkia>* icons) {
icons->push_back(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( icons->push_back(*ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_DEFAULT_FAVICON)); IDR_DEFAULT_FAVICON).ToImageSkia());
icons->push_back(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( icons->push_back(*ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_COOKIE_ICON)); IDR_COOKIE_ICON).ToImageSkia());
icons->push_back(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed( icons->push_back(*ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_COOKIE_STORAGE_ICON)); IDR_COOKIE_STORAGE_ICON).ToImageSkia());
} }
// Returns the index of the icon to use for |node|. Return -1 to use the // Returns the index of the icon to use for |node|. Return -1 to use the
......
...@@ -1758,9 +1758,9 @@ std::string ChromeContentBrowserClient::GetAcceptLangs( ...@@ -1758,9 +1758,9 @@ std::string ChromeContentBrowserClient::GetAcceptLangs(
return profile->GetPrefs()->GetString(prefs::kAcceptLanguages); return profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
} }
gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() { const gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() {
ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ResourceBundle& rb = ResourceBundle::GetSharedInstance();
return rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON); return rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia();
} }
bool ChromeContentBrowserClient::AllowAppCache( bool ChromeContentBrowserClient::AllowAppCache(
......
...@@ -134,7 +134,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { ...@@ -134,7 +134,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
virtual std::string GetApplicationLocale() OVERRIDE; virtual std::string GetApplicationLocale() OVERRIDE;
virtual std::string GetAcceptLangs( virtual std::string GetAcceptLangs(
content::BrowserContext* context) OVERRIDE; content::BrowserContext* context) OVERRIDE;
virtual gfx::ImageSkia* GetDefaultFavicon() OVERRIDE; virtual const gfx::ImageSkia* GetDefaultFavicon() OVERRIDE;
virtual bool AllowAppCache(const GURL& manifest_url, virtual bool AllowAppCache(const GURL& manifest_url,
const GURL& first_party, const GURL& first_party,
content::ResourceContext* context) OVERRIDE; content::ResourceContext* context) OVERRIDE;
......
...@@ -742,8 +742,9 @@ gfx::ImageSkia TaskManagerModel::GetResourceIcon(int index) const { ...@@ -742,8 +742,9 @@ gfx::ImageSkia TaskManagerModel::GetResourceIcon(int index) const {
if (!icon.isNull()) if (!icon.isNull())
return icon; return icon;
static gfx::ImageSkia* default_icon = ResourceBundle::GetSharedInstance(). static const gfx::ImageSkia* default_icon =
GetImageSkiaNamed(IDR_DEFAULT_FAVICON); ResourceBundle::GetSharedInstance().
GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia();
return *default_icon; return *default_icon;
} }
......
...@@ -36,7 +36,7 @@ static const int kExtensionGroupID = 2; ...@@ -36,7 +36,7 @@ static const int kExtensionGroupID = 2;
// ModelEntry also tracks state information about the URL. // ModelEntry also tracks state information about the URL.
// Icon used while loading, or if a specific favicon can't be found. // Icon used while loading, or if a specific favicon can't be found.
static gfx::ImageSkia* default_icon = NULL; static const gfx::ImageSkia* default_icon = NULL;
class ModelEntry { class ModelEntry {
public: public:
...@@ -46,7 +46,7 @@ class ModelEntry { ...@@ -46,7 +46,7 @@ class ModelEntry {
model_(model) { model_(model) {
if (!default_icon) { if (!default_icon) {
default_icon = ResourceBundle::GetSharedInstance(). default_icon = ResourceBundle::GetSharedInstance().
GetImageSkiaNamed(IDR_DEFAULT_FAVICON); GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia();
} }
} }
......
...@@ -105,7 +105,7 @@ std::string ContentBrowserClient::GetAcceptLangs(BrowserContext* context) { ...@@ -105,7 +105,7 @@ std::string ContentBrowserClient::GetAcceptLangs(BrowserContext* context) {
return std::string(); return std::string();
} }
gfx::ImageSkia* ContentBrowserClient::GetDefaultFavicon() { const gfx::ImageSkia* ContentBrowserClient::GetDefaultFavicon() {
static gfx::ImageSkia* empty = new gfx::ImageSkia(); static gfx::ImageSkia* empty = new gfx::ImageSkia();
return empty; return empty;
} }
......
...@@ -300,7 +300,7 @@ class CONTENT_EXPORT ContentBrowserClient { ...@@ -300,7 +300,7 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual std::string GetAcceptLangs(BrowserContext* context); virtual std::string GetAcceptLangs(BrowserContext* context);
// Returns the default favicon. The callee doesn't own the given bitmap. // Returns the default favicon. The callee doesn't own the given bitmap.
virtual gfx::ImageSkia* GetDefaultFavicon(); virtual const gfx::ImageSkia* GetDefaultFavicon();
// Allow the embedder to control if an AppCache can be used for the given url. // Allow the embedder to control if an AppCache can be used for the given url.
// This is called on the IO thread. // This is called on the IO thread.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment