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

Unified Diff: chrome/browser/custom_home_pages_table_model.cc

Issue 3028030: Remove static caching of default favicon in CustomHomePagesTableModel (Closed)
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/custom_home_pages_table_model.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/custom_home_pages_table_model.cc
diff --git a/chrome/browser/custom_home_pages_table_model.cc b/chrome/browser/custom_home_pages_table_model.cc
index 446aea54c2fcb1a7ba6052ebab81d66ea4def81c..6095afea6644a68cced0853d27f312535d09db94 100644
--- a/chrome/browser/custom_home_pages_table_model.cc
+++ b/chrome/browser/custom_home_pages_table_model.cc
@@ -19,13 +19,12 @@
#include "grit/generated_resources.h"
#include "net/base/net_util.h"
-// static
-SkBitmap CustomHomePagesTableModel::default_favicon_;
-
CustomHomePagesTableModel::CustomHomePagesTableModel(Profile* profile)
- : profile_(profile),
+ : default_favicon_(NULL),
+ profile_(profile),
observer_(NULL) {
- InitClass();
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ default_favicon_ = rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
}
void CustomHomePagesTableModel::SetURLs(const std::vector<GURL>& urls) {
@@ -109,7 +108,7 @@ std::wstring CustomHomePagesTableModel::GetText(int row, int column_id) {
SkBitmap CustomHomePagesTableModel::GetIcon(int row) {
DCHECK(row >= 0 && row < RowCount());
- return entries_[row].icon.isNull() ? default_favicon_ : entries_[row].icon;
+ return entries_[row].icon.isNull() ? *default_favicon_ : entries_[row].icon;
}
std::wstring CustomHomePagesTableModel::GetTooltip(int row) {
@@ -122,15 +121,6 @@ void CustomHomePagesTableModel::SetObserver(TableModelObserver* observer) {
observer_ = observer;
}
-void CustomHomePagesTableModel::InitClass() {
- static bool initialized = false;
- if (!initialized) {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
- initialized = true;
- }
-}
-
void CustomHomePagesTableModel::LoadTitleAndFavIcon(Entry* entry) {
HistoryService* history_service =
profile_->GetHistoryService(Profile::EXPLICIT_ACCESS);
« no previous file with comments | « chrome/browser/custom_home_pages_table_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698