diff options
author | nshkrob@chromium.org <nshkrob@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 21:46:09 +0000 |
---|---|---|
committer | nshkrob@chromium.org <nshkrob@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 21:46:09 +0000 |
commit | f33b82f2e0be4b3c739f3e51f34b680080e0150e (patch) | |
tree | 8cb4ad562fdef2e2b95809b06be9af697b61d410 /chrome/browser/history/history_backend.cc | |
parent | 6472ca20fbcf08b42dfb8cc20a5066910f038404 (diff) | |
download | chromium_src-f33b82f2e0be4b3c739f3e51f34b680080e0150e.zip chromium_src-f33b82f2e0be4b3c739f3e51f34b680080e0150e.tar.gz chromium_src-f33b82f2e0be4b3c739f3e51f34b680080e0150e.tar.bz2 |
Rename the Thumbnails database file to Favicons.
The database will no longer store the thumbnails - TopSites is storing it's own thumbnails.
BUG=None
TEST=ThumbnailDatabaseTest
Review URL: http://codereview.chromium.org/2842034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51294 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/history_backend.cc')
-rw-r--r-- | chrome/browser/history/history_backend.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index 742f458..3eb7c76 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -273,6 +273,10 @@ FilePath HistoryBackend::GetThumbnailFileName() const { return history_dir_.Append(chrome::kThumbnailsFilename); } +FilePath HistoryBackend::GetFaviconsFileName() const { + return history_dir_.Append(chrome::kFaviconsFilename); +} + FilePath HistoryBackend::GetArchivedFileName() const { return history_dir_.Append(chrome::kArchivedHistoryFilename); } @@ -578,6 +582,12 @@ void HistoryBackend::InitImpl() { // Thumbnail database. thumbnail_db_.reset(new ThumbnailDatabase()); + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopSites)) { + if (!file_util::PathExists(thumbnail_name)) { + // No convertion needed - use new filename right away. + thumbnail_name = GetFaviconsFileName(); + } + } if (thumbnail_db_->Init(thumbnail_name, history_publisher_.get()) != sql::INIT_OK) { // Unlike the main database, we don't error out when the database is too @@ -2146,8 +2156,9 @@ BookmarkService* HistoryBackend::GetBookmarkService() { return bookmark_service_; } -void HistoryBackend::DeleteThumbnailsDatabase() { - thumbnail_db_->DropThumbnailsTable(); +void HistoryBackend::MigrateThumbnailsDatabase() { + thumbnail_db_->RenameAndDropThumbnails(GetThumbnailFileName(), + GetFaviconsFileName()); } } // namespace history |