Modified ThumbnailStore to cache/store JPEGs instead
of SkBitmaps.

Add command line flag "--thumbnail-store" to enable
using the ThumbnailStore facility instead of the current
ThumbnailDatabase.

Original review: http://codereview.chromium.org/118409
Patch by Meelap Shah

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17971 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index f493a427..b7bd98d 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -28,6 +28,7 @@
 #include "chrome/browser/sessions/tab_restore_service.h"
 #include "chrome/browser/spellchecker.h"
 #include "chrome/browser/ssl/ssl_host_state.h"
+#include "chrome/browser/thumbnail_store.h"
 #include "chrome/browser/browser_theme_provider.h"
 #include "chrome/browser/visitedlink_master.h"
 #include "chrome/browser/webdata/web_data_service.h"
@@ -343,6 +344,10 @@
     return profile_->GetSpellChecker();
   }
 
+  virtual ThumbnailStore* GetThumbnailStore() {
+    return NULL;
+  }
+
   virtual void MarkAsCleanShutdown() {
   }
 
@@ -926,6 +931,14 @@
   return tab_restore_service_.get();
 }
 
+ThumbnailStore* ProfileImpl::GetThumbnailStore() {
+  if (!thumbnail_store_.get()) {
+    thumbnail_store_ = new ThumbnailStore;
+    thumbnail_store_->Init(GetPath().AppendASCII("thumbnailstore\\"));
+  }
+  return thumbnail_store_.get();
+}
+
 void ProfileImpl::ResetTabRestoreService() {
   tab_restore_service_ = NULL;
 }