Chromium Code Reviews| Index: components/history/core/browser/history_client.h |
| diff --git a/components/history/core/browser/history_client.h b/components/history/core/browser/history_client.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1756fb6c1c517da513bfd49ed5443fa13df632f0 |
| --- /dev/null |
| +++ b/components/history/core/browser/history_client.h |
| @@ -0,0 +1,52 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ |
| +#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "base/strings/string16.h" |
| +#include "url/gurl.h" |
| + |
| +namespace history { |
| + |
| +struct URLAndTitle { |
| + GURL url; |
| + base::string16 title; |
| +}; |
| + |
| +// 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.
|
| +// e.g. Chrome. |
| +class HistoryClient { |
| + public: |
| + // Waits until the bookmarks have been loaded. |
| + // |
| + // Must not be called from the main thread. |
| + virtual void BlockTillBookmarksLoaded(); |
|
blundell
2014/05/26 07:16:58
s/Till/Until
sdefresne
2014/05/26 16:34:02
Done.
|
| + |
| + // Returns true if the specified URL is bookmarked. |
| + // |
| + // 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.
|
| + virtual bool IsBookmarked(const GURL& url); |
| + |
| + // 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 even if the title are not |
| + // the same. |
| + // |
| + // If not on the main thread, then you must call BlockTillLoaded first. |
| + virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks); |
| + |
| + protected: |
| + HistoryClient() {} |
| + virtual ~HistoryClient() {} |
| + |
| + DISALLOW_COPY_AND_ASSIGN(HistoryClient); |
| +}; |
| + |
| +} // namespace history |
| + |
| +#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ |