diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 20:04:28 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-09 20:04:28 +0000 |
commit | 449478308895f2f09eacfb4971b9917627aa3152 (patch) | |
tree | 8e5986eb759388f6eafb16dcbb532b850516e5c4 /chrome/browser/tab_contents | |
parent | 7670df01a5a53fc1c39a0e0008813985d80ebae7 (diff) | |
download | chromium_src-449478308895f2f09eacfb4971b9917627aa3152.zip chromium_src-449478308895f2f09eacfb4971b9917627aa3152.tar.gz chromium_src-449478308895f2f09eacfb4971b9917627aa3152.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index db21d93..a39f7eb 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -37,6 +37,7 @@ #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/tab_contents_delegate.h" #include "chrome/browser/tab_contents/tab_contents_view.h" +#include "chrome/browser/thumbnail_store.h" #include "chrome/browser/search_engines/template_url_fetcher.h" #include "chrome/browser/search_engines/template_url_model.h" #include "chrome/common/chrome_switches.h" @@ -1633,10 +1634,15 @@ void TabContents::UpdateThumbnail(const GURL& url, const SkBitmap& bitmap, const ThumbnailScore& score) { // Tell History about this thumbnail - HistoryService* hs; - if (!profile()->IsOffTheRecord() && - (hs = profile()->GetHistoryService(Profile::IMPLICIT_ACCESS))) { - hs->SetPageThumbnail(url, bitmap, score); + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kThumbnailStore)) { + profile()->GetThumbnailStore()-> + SetPageThumbnail(url, bitmap, score, !profile()->IsOffTheRecord()); + } else { + HistoryService* hs; + if (!profile()->IsOffTheRecord() && + (hs = profile()->GetHistoryService(Profile::IMPLICIT_ACCESS))) { + hs->SetPageThumbnail(url, bitmap, score); + } } } |