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

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

Issue 10825147: Made BookmarkService::GetBookmarks return both urls and title. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: splited into 2 cls Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_ 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_ 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 class GURL; 10 #include "base/string16.h"
11 #include "googleurl/src/gurl.h"
11 12
12 // BookmarkService provides a thread safe view of bookmarks. It is used by 13 // BookmarkService provides a thread safe view of bookmarks. It is used by
13 // HistoryBackend when it needs to determine the set of bookmarked URLs 14 // HistoryBackend when it needs to determine the set of bookmarked URLs
14 // or if a URL is bookmarked. 15 // or if a URL is bookmarked.
15 // 16 //
16 // BookmarkService is owned by Profile and deleted when the Profile is deleted. 17 // BookmarkService is owned by Profile and deleted when the Profile is deleted.
17 class BookmarkService { 18 class BookmarkService {
18 public: 19 public:
20 struct Bookmark {
sky 2012/08/03 16:04:39 This name is too generic, how about URLAndTitle.
michaelbai 2012/08/03 17:57:49 I was thinking it might not so generic as it is de
21 string16 title;
22 GURL url;
23 };
24
19 // Returns true if the specified URL is bookmarked. 25 // Returns true if the specified URL is bookmarked.
20 // 26 //
21 // If not on the main thread you *must* invoke BlockTillLoaded first. 27 // If not on the main thread you *must* invoke BlockTillLoaded first.
22 virtual bool IsBookmarked(const GURL& url) = 0; 28 virtual bool IsBookmarked(const GURL& url) = 0;
23 29
24 // Returns, by reference in urls, the set of bookmarked urls. This returns 30 // Returns, by reference in |bookmarks|, the set of bookmarked urls and their
25 // the unique set of URLs. For example, if two bookmarks reference the same 31 // titles. This returns the unique set of URLs. For example, if two bookmarks
26 // URL only one entry is added. 32 // reference the same URL only one entry is added not matter the titles are
33 // same or not.
27 // 34 //
28 // If not on the main thread you *must* invoke BlockTillLoaded first. 35 // If not on the main thread you *must* invoke BlockTillLoaded first.
29 virtual void GetBookmarks(std::vector<GURL>* urls) = 0; 36 virtual void GetBookmarks(std::vector<Bookmark>* bookmarks) = 0;
30 37
31 // Blocks until loaded. This is intended for usage on a thread other than 38 // Blocks until loaded. This is intended for usage on a thread other than
32 // the main thread. 39 // the main thread.
33 virtual void BlockTillLoaded() = 0; 40 virtual void BlockTillLoaded() = 0;
34 41
35 protected: 42 protected:
36 virtual ~BookmarkService() {} 43 virtual ~BookmarkService() {}
37 }; 44 };
38 45
39 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_ 46 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698