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

Side by Side Diff: chrome/browser/bookmarks/bookmark_service.h

Issue 10868039: Promote BookmarkService to a public API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync. Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model.h ('k') | chrome/browser/history/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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.
4
5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_
7
8 #include <vector>
9
10 #include "base/string16.h"
11 #include "googleurl/src/gurl.h"
12
13 // BookmarkService provides a thread safe view of bookmarks. It is used by
14 // HistoryBackend when it needs to determine the set of bookmarked URLs
15 // or if a URL is bookmarked.
16 //
17 // BookmarkService is owned by Profile and deleted when the Profile is deleted.
18 class BookmarkService {
19 public:
20 struct URLAndTitle {
21 GURL url;
22 string16 title;
23 };
24
25 // Returns true if the specified URL is bookmarked.
26 //
27 // If not on the main thread you *must* invoke BlockTillLoaded first.
28 virtual bool IsBookmarked(const GURL& url) = 0;
29
30 // Returns, by reference in |bookmarks|, the set of bookmarked urls and their
31 // titles. This returns the unique set of URLs. For example, if two bookmarks
32 // reference the same URL only one entry is added not matter the titles are
33 // same or not.
34 //
35 // If not on the main thread you *must* invoke BlockTillLoaded first.
36 virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks) = 0;
37
38 // Blocks until loaded. This is intended for usage on a thread other than
39 // the main thread.
40 virtual void BlockTillLoaded() = 0;
41
42 protected:
43 virtual ~BookmarkService() {}
44 };
45
46 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model.h ('k') | chrome/browser/history/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698