Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7028)

Unified Diff: components/bookmarks/browser/bookmark_model.h

Issue 306143003: Remove the BookmarkService interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@371825.2
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/bookmarks.gypi ('k') | components/bookmarks/browser/bookmark_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bookmarks/browser/bookmark_model.h
diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h
index e4aacf28b8fb53bdb808d19983fcd76288d73b5a..9c4d8c41872cef3fea06250585aaac715933bb36 100644
--- a/components/bookmarks/browser/bookmark_model.h
+++ b/components/bookmarks/browser/bookmark_model.h
@@ -19,7 +19,6 @@
#include "base/synchronization/waitable_event.h"
#include "components/bookmarks/browser/bookmark_client.h"
#include "components/bookmarks/browser/bookmark_node.h"
-#include "components/bookmarks/browser/bookmark_service.h"
#include "ui/gfx/image/image.h"
#include "url/gurl.h"
@@ -59,12 +58,17 @@ class TestBookmarkClient;
//
// You should NOT directly create a BookmarkModel, instead go through the
// BookmarkModelFactory.
-class BookmarkModel : public BookmarkService {
+class BookmarkModel {
public:
+ struct URLAndTitle {
+ GURL url;
+ base::string16 title;
+ };
+
// |index_urls| says whether URLs should be stored in the BookmarkIndex
// in addition to bookmark titles.
BookmarkModel(BookmarkClient* client, bool index_urls);
- virtual ~BookmarkModel();
+ ~BookmarkModel();
// Invoked prior to destruction to release any necessary resources.
void Shutdown();
@@ -172,20 +176,22 @@ class BookmarkModel : public BookmarkService {
// This method is thread safe.
bool HasBookmarks();
- // Returns true if there is a bookmark with the |url|.
- // This method is thread safe.
- // See BookmarkService for more details on this.
- virtual bool IsBookmarked(const GURL& url) OVERRIDE;
+ // Returns true if the specified URL is bookmarked.
+ //
+ // If not on the main thread you *must* invoke BlockTillLoaded first.
+ bool IsBookmarked(const GURL& url);
- // Returns all the bookmarked urls and their titles.
- // This method is thread safe.
- // See BookmarkService for more details on this.
- virtual void GetBookmarks(
- std::vector<BookmarkService::URLAndTitle>* urls) OVERRIDE;
+ // Returns, by reference in |bookmarks|, the set of bookmarked urls and their
+ // titles. This returns the unique set of URLs. For example, if two bookmarks
+ // reference the same URL only one entry is added not matter the titles are
+ // same or not.
+ //
+ // If not on the main thread you *must* invoke BlockTillLoaded first.
+ void GetBookmarks(std::vector<BookmarkModel::URLAndTitle>* urls);
- // Blocks until loaded; this is NOT invoked on the main thread.
- // See BookmarkService for more details on this.
- virtual void BlockTillLoaded() OVERRIDE;
+ // Blocks until loaded. This is intended for usage on a thread other than
+ // the main thread.
+ void BlockTillLoaded();
// Adds a new folder node at the specified position.
const BookmarkNode* AddFolder(const BookmarkNode* parent,
« no previous file with comments | « components/bookmarks.gypi ('k') | components/bookmarks/browser/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698