1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_SERVICE_H_
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_SERVICE_H_
10 #include "base/strings/string16.h"
13 // BookmarkService provides a thread safe view of bookmarks. It can be used
14 // to determine the set of bookmarked URLs or to check if an URL is bookmarked.
15 class BookmarkService
{
22 // Returns true if the specified URL is bookmarked.
24 // If not on the main thread you *must* invoke BlockTillLoaded first.
25 virtual bool IsBookmarked(const GURL
& url
) = 0;
27 // Returns, by reference in |bookmarks|, the set of bookmarked urls and their
28 // titles. This returns the unique set of URLs. For example, if two bookmarks
29 // reference the same URL only one entry is added not matter the titles are
32 // If not on the main thread you *must* invoke BlockTillLoaded first.
33 virtual void GetBookmarks(std::vector
<URLAndTitle
>* bookmarks
) = 0;
35 // Blocks until loaded. This is intended for usage on a thread other than
37 virtual void BlockTillLoaded() = 0;
40 virtual ~BookmarkService() {}
43 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_SERVICE_H_