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(
return GetAcceptLangsImpl();
}
gfx::ImageSkia* AwContentBrowserClient::GetDefaultFavicon() {
const gfx::ImageSkia* AwContentBrowserClient::GetDefaultFavicon() {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
// TODO(boliu): Bundle our own default favicon?
return rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
......
......@@ -57,7 +57,7 @@ class AwContentBrowserClient : public content::ContentBrowserClient {
int child_process_id) OVERRIDE;
virtual std::string GetApplicationLocale() 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,
const GURL& first_party,
content::ResourceContext* context) OVERRIDE;
......
......@@ -883,12 +883,12 @@ CookiesTreeModel::~CookiesTreeModel() {
// 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.
void CookiesTreeModel::GetIcons(std::vector<gfx::ImageSkia>* icons) {
icons->push_back(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_DEFAULT_FAVICON));
icons->push_back(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_COOKIE_ICON));
icons->push_back(*ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_COOKIE_STORAGE_ICON));
icons->push_back(*ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_DEFAULT_FAVICON).ToImageSkia());
icons->push_back(*ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_COOKIE_ICON).ToImageSkia());
icons->push_back(*ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_COOKIE_STORAGE_ICON).ToImageSkia());
}
// Returns the index of the icon to use for |node|. Return -1 to use the
......
......@@ -1758,9 +1758,9 @@ std::string ChromeContentBrowserClient::GetAcceptLangs(
return profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
}
gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() {
const gfx::ImageSkia* ChromeContentBrowserClient::GetDefaultFavicon() {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
return rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
return rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia();
}
bool ChromeContentBrowserClient::AllowAppCache(
......
......@@ -134,7 +134,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
virtual std::string GetApplicationLocale() 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,
const GURL& first_party,
content::ResourceContext* context) OVERRIDE;
......
......@@ -742,8 +742,9 @@ gfx::ImageSkia TaskManagerModel::GetResourceIcon(int index) const {
if (!icon.isNull())
return icon;
static gfx::ImageSkia* default_icon = ResourceBundle::GetSharedInstance().
GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
static const gfx::ImageSkia* default_icon =
ResourceBundle::GetSharedInstance().
GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia();
return *default_icon;
}
......
......@@ -36,7 +36,7 @@ static const int kExtensionGroupID = 2;
// ModelEntry also tracks state information about the URL.
// 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 {
public:
......@@ -46,7 +46,7 @@ class ModelEntry {
model_(model) {
if (!default_icon) {
default_icon = ResourceBundle::GetSharedInstance().
GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
GetNativeImageNamed(IDR_DEFAULT_FAVICON).ToImageSkia();
}
}
......
......@@ -105,7 +105,7 @@ std::string ContentBrowserClient::GetAcceptLangs(BrowserContext* context) {
return std::string();
}
gfx::ImageSkia* ContentBrowserClient::GetDefaultFavicon() {
const gfx::ImageSkia* ContentBrowserClient::GetDefaultFavicon() {
static gfx::ImageSkia* empty = new gfx::ImageSkia();
return empty;
}
......
......@@ -300,7 +300,7 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual std::string GetAcceptLangs(BrowserContext* context);
// 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.
// 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