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

Side by Side Diff: components/history/core/browser/history_client.h

Issue 285233012: Abstract history dependencies on bookmarks through HistoryClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 7 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
OLDNEW
(Empty)
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.
4
5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "base/strings/string16.h"
12 #include "url/gurl.h"
13
14 namespace history {
15
16 struct URLAndTitle {
17 GURL url;
18 base::string16 title;
19 };
20
21 // This class abstracts operations that depends on the embedder's environment,
blundell 2014/05/26 07:16:58 s/depends/depend
sdefresne 2014/05/26 16:34:02 Done.
22 // e.g. Chrome.
23 class HistoryClient {
24 public:
25 // Waits until the bookmarks have been loaded.
26 //
27 // Must not be called from the main thread.
28 virtual void BlockTillBookmarksLoaded();
blundell 2014/05/26 07:16:58 s/Till/Until
sdefresne 2014/05/26 16:34:02 Done.
29
30 // Returns true if the specified URL is bookmarked.
31 //
32 // If not on the main thread, then you must call BlockTillLoaded first.
blundell 2014/05/26 07:16:58 s/you must call BlockTillLoaded/BlockTillLoaded mu
sdefresne 2014/05/26 16:34:02 Done.
33 virtual bool IsBookmarked(const GURL& url);
34
35 // Returns, by reference in |bookmarks|, the set of bookmarked urls and their
36 // titles. This returns the unique set of URLs. For example, if two bookmarks
37 // reference the same URL only one entry is added even if the title are not
38 // the same.
39 //
40 // If not on the main thread, then you must call BlockTillLoaded first.
41 virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks);
42
43 protected:
44 HistoryClient() {}
45 virtual ~HistoryClient() {}
46
47 DISALLOW_COPY_AND_ASSIGN(HistoryClient);
48 };
49
50 } // namespace history
51
52 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698