| Index: components/enhanced_bookmarks/bookmark_image_service.cc
|
| diff --git a/components/enhanced_bookmarks/bookmark_image_service.cc b/components/enhanced_bookmarks/bookmark_image_service.cc
|
| index 5f515a9fbfd56e46d30323b27fd49f2dfd317b91..4354c54d7de9e2e805768b32915bab473c0a570d 100644
|
| --- a/components/enhanced_bookmarks/bookmark_image_service.cc
|
| +++ b/components/enhanced_bookmarks/bookmark_image_service.cc
|
| @@ -8,8 +8,8 @@
|
| #include "base/threading/sequenced_worker_pool.h"
|
| #include "components/bookmarks/browser/bookmark_model.h"
|
| #include "components/bookmarks/browser/bookmark_model_observer.h"
|
| +#include "components/enhanced_bookmarks/enhanced_bookmark_model.h"
|
| #include "components/enhanced_bookmarks/enhanced_bookmark_utils.h"
|
| -#include "components/enhanced_bookmarks/metadata_accessor.h"
|
| #include "components/enhanced_bookmarks/persistent_image_store.h"
|
|
|
| namespace {
|
| @@ -43,8 +43,12 @@ namespace enhanced_bookmarks {
|
| BookmarkImageService::BookmarkImageService(
|
| scoped_ptr<ImageStore> store,
|
| BookmarkModel* bookmark_model,
|
| + EnhancedBookmarkModel* enhanced_bookmark_model,
|
| scoped_refptr<base::SequencedWorkerPool> pool)
|
| - : bookmark_model_(bookmark_model), store_(store.Pass()), pool_(pool) {
|
| + : bookmark_model_(bookmark_model),
|
| + enhanced_bookmark_model_(enhanced_bookmark_model),
|
| + store_(store.Pass()),
|
| + pool_(pool) {
|
| DCHECK(CalledOnValidThread());
|
| bookmark_model_->AddObserver(this);
|
| }
|
| @@ -52,8 +56,11 @@ BookmarkImageService::BookmarkImageService(
|
| BookmarkImageService::BookmarkImageService(
|
| const base::FilePath& path,
|
| BookmarkModel* bookmark_model,
|
| + EnhancedBookmarkModel* enhanced_bookmark_model,
|
| scoped_refptr<base::SequencedWorkerPool> pool)
|
| - : bookmark_model_(bookmark_model), pool_(pool) {
|
| + : bookmark_model_(bookmark_model),
|
| + enhanced_bookmark_model_(enhanced_bookmark_model),
|
| + pool_(pool) {
|
| DCHECK(CalledOnValidThread());
|
| // PersistentImageStore has to be constructed in the thread it will be used,
|
| // so we are posting the construction to the thread. However, we first
|
| @@ -123,7 +130,7 @@ void BookmarkImageService::RetrieveSalientImageForPageUrl(
|
| if (bookmark) {
|
| int width;
|
| int height;
|
| - enhanced_bookmarks::ThumbnailImageFromBookmark(
|
| + enhanced_bookmark_model_->GetThumbnailImageForNode(
|
| bookmark, &image_url, &width, &height);
|
| }
|
|
|
| @@ -191,8 +198,8 @@ void BookmarkImageService::ProcessNewImage(const GURL& page_url,
|
| bookmark_model_->GetMostRecentlyAddedUserNodeForURL(page_url);
|
| if (bookmark) {
|
| const gfx::Size& size = image.Size();
|
| - bool result = enhanced_bookmarks::SetOriginalImageForBookmark(
|
| - bookmark_model_, bookmark, image_url, size.width(), size.height());
|
| + bool result = enhanced_bookmark_model_->SetOriginalImageForNode(
|
| + bookmark, image_url, size.width(), size.height());
|
| DCHECK(result);
|
| }
|
| }
|
|
|