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..ef12094cb493de91c86fc03f010330742c1ace90 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(), false); |
Yaron
2014/09/05 03:16:53
what does stars.userEdit mean? This can be as a re
Rune Fevang
2014/09/05 03:40:26
I don't understand the purpose of this field mysel
Mark
2014/09/08 22:47:08
The idea is that not all client edits are necessar
Yaron
2014/09/08 23:30:39
Sure, but then it should be true here which I see
|
DCHECK(result); |
} |
} |