| Index: components/history/core/test/history_client_fake_bookmarks.cc
|
| diff --git a/components/history/core/test/history_client_fake_bookmarks.cc b/components/history/core/test/history_client_fake_bookmarks.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..95c6e0f9039aec8a2272a7139ca9c6c2746bc56c
|
| --- /dev/null
|
| +++ b/components/history/core/test/history_client_fake_bookmarks.cc
|
| @@ -0,0 +1,41 @@
|
| +// 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.
|
| +
|
| +#include "components/history/core/test/history_client_fake_bookmarks.h"
|
| +
|
| +namespace history {
|
| +
|
| +HistoryClientFakeBookmarks::HistoryClientFakeBookmarks() {
|
| +}
|
| +
|
| +HistoryClientFakeBookmarks::~HistoryClientFakeBookmarks() {
|
| +}
|
| +
|
| +void HistoryClientFakeBookmarks::ClearAllBookmarks() {
|
| + bookmarked_urls_.clear();
|
| +}
|
| +
|
| +void HistoryClientFakeBookmarks::AddBookmark(const GURL& url) {
|
| + bookmarked_urls_.insert(url);
|
| +}
|
| +
|
| +void HistoryClientFakeBookmarks::DelBookmark(const GURL& url) {
|
| + bookmarked_urls_.erase(url);
|
| +}
|
| +
|
| +bool HistoryClientFakeBookmarks::IsBookmarked(const GURL& url) {
|
| + return bookmarked_urls_.find(url) != bookmarked_urls_.end();
|
| +}
|
| +
|
| +void HistoryClientFakeBookmarks::GetBookmarks(
|
| + std::vector<URLAndTitle> *bookmarks) {
|
| + bookmarks->reserve(bookmarks->size() + bookmarked_urls_.size());
|
| + for (std::set<GURL>::const_iterator i = bookmarked_urls_.begin();
|
| + i != bookmarked_urls_.end(); ++i) {
|
| + URLAndTitle urlAndTitle = { *i, base::string16() };
|
| + bookmarks->push_back(urlAndTitle);
|
| + }
|
| +}
|
| +
|
| +} // namespace history
|
|
|