| Index: components/history/core/browser/history_client_mock_bookmarks.cc
|
| diff --git a/components/history/core/browser/history_client_mock_bookmarks.cc b/components/history/core/browser/history_client_mock_bookmarks.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cc2ad4218709e381650f26797571fab1b4b789be
|
| --- /dev/null
|
| +++ b/components/history/core/browser/history_client_mock_bookmarks.cc
|
| @@ -0,0 +1,39 @@
|
| +// 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/browser/history_client_mock_bookmarks.h"
|
| +
|
| +namespace history {
|
| +
|
| +HistoryClientMockBookmarks::HistoryClientMockBookmarks() {}
|
| +
|
| +HistoryClientMockBookmarks::~HistoryClientMockBookmarks() {}
|
| +
|
| +void HistoryClientMockBookmarks::ClearAllBookmarks() {
|
| + bookmarked_urls_.clear();
|
| +}
|
| +
|
| +void HistoryClientMockBookmarks::AddBookmark(const GURL& url) {
|
| + bookmarked_urls_.insert(url);
|
| +}
|
| +
|
| +void HistoryClientMockBookmarks::DelBookmark(const GURL& url) {
|
| + bookmarked_urls_.erase(url);
|
| +}
|
| +
|
| +bool HistoryClientMockBookmarks::IsBookmarked(const GURL& url) {
|
| + return bookmarked_urls_.find(url) != bookmarked_urls_.end();
|
| +}
|
| +
|
| +void HistoryClientMockBookmarks::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
|
|
|