Index: chrome/browser/ui/webui/ntp/thumbnail_source.cc |
diff --git a/chrome/browser/ui/webui/ntp/thumbnail_source.cc b/chrome/browser/ui/webui/ntp/thumbnail_source.cc |
index 324c69432c744b534cc10b0a9e42e7d61d4ffe53..e43c9acbd245cd36fe2ad8de4511b2540edcc31c 100644 |
--- a/chrome/browser/ui/webui/ntp/thumbnail_source.cc |
+++ b/chrome/browser/ui/webui/ntp/thumbnail_source.cc |
@@ -19,17 +19,26 @@ |
using content::BrowserThread; |
-// Set ThumbnailService now as Profile isn't thread safe. |
+// Set ThumbnailService now as Profile isn't thread safe. By default, perform |
+// exact match only. |
ThumbnailSource::ThumbnailSource(Profile* profile) |
: thumbnail_service_(ThumbnailServiceFactory::GetForProfile(profile)), |
- profile_(profile) { |
+ profile_(profile), |
+ prefix_match_(false) { |
+} |
+ |
+ThumbnailSource::ThumbnailSource(Profile* profile, bool prefix_match) |
+ : thumbnail_service_(ThumbnailServiceFactory::GetForProfile(profile)), |
+ profile_(profile), |
+ prefix_match_(prefix_match) { |
} |
ThumbnailSource::~ThumbnailSource() { |
} |
std::string ThumbnailSource::GetSource() const { |
- return chrome::kChromeUIThumbnailHost; |
+ return prefix_match_ ? |
+ chrome::kChromeUIThumbnailHost2 : chrome::kChromeUIThumbnailHost; |
} |
void ThumbnailSource::StartDataRequest( |
@@ -38,7 +47,7 @@ void ThumbnailSource::StartDataRequest( |
int render_view_id, |
const content::URLDataSource::GotDataCallback& callback) { |
scoped_refptr<base::RefCountedMemory> data; |
- if (thumbnail_service_->GetPageThumbnail(GURL(path), &data)) { |
+ if (thumbnail_service_->GetPageThumbnail(GURL(path), prefix_match_, &data)) { |
// We have the thumbnail. |
callback.Run(data.get()); |
} else { |