OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "components/history/core/test/history_client_fake_bookmarks.h" | 5 #include "components/history/core/test/history_client_fake_bookmarks.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 class HistoryBackendClientFakeBookmarks : public HistoryBackendClient { | 74 class HistoryBackendClientFakeBookmarks : public HistoryBackendClient { |
75 public: | 75 public: |
76 explicit HistoryBackendClientFakeBookmarks( | 76 explicit HistoryBackendClientFakeBookmarks( |
77 const scoped_refptr<FakeBookmarkDatabase>& bookmarks); | 77 const scoped_refptr<FakeBookmarkDatabase>& bookmarks); |
78 ~HistoryBackendClientFakeBookmarks() override; | 78 ~HistoryBackendClientFakeBookmarks() override; |
79 | 79 |
80 // HistoryBackendClient implementation. | 80 // HistoryBackendClient implementation. |
81 bool IsBookmarked(const GURL& url) override; | 81 bool IsBookmarked(const GURL& url) override; |
82 void GetBookmarks(std::vector<URLAndTitle>* bookmarks) override; | 82 void GetBookmarks(std::vector<URLAndTitle>* bookmarks) override; |
83 bool ShouldReportDatabaseError() override; | 83 bool ShouldReportDatabaseError() override; |
| 84 bool IsWebSafe(const GURL& url) override; |
84 #if defined(OS_ANDROID) | 85 #if defined(OS_ANDROID) |
85 void OnHistoryBackendInitialized(HistoryBackend* history_backend, | 86 void OnHistoryBackendInitialized(HistoryBackend* history_backend, |
86 HistoryDatabase* history_database, | 87 HistoryDatabase* history_database, |
87 ThumbnailDatabase* thumbnail_database, | 88 ThumbnailDatabase* thumbnail_database, |
88 const base::FilePath& history_dir) override; | 89 const base::FilePath& history_dir) override; |
89 void OnHistoryBackendDestroyed(HistoryBackend* history_backend, | 90 void OnHistoryBackendDestroyed(HistoryBackend* history_backend, |
90 const base::FilePath& history_dir) override; | 91 const base::FilePath& history_dir) override; |
91 #endif // defined(OS_ANDROID) | 92 #endif // defined(OS_ANDROID) |
92 | 93 |
93 private: | 94 private: |
(...skipping 16 matching lines...) Expand all Loading... |
110 | 111 |
111 void HistoryBackendClientFakeBookmarks::GetBookmarks( | 112 void HistoryBackendClientFakeBookmarks::GetBookmarks( |
112 std::vector<URLAndTitle>* bookmarks) { | 113 std::vector<URLAndTitle>* bookmarks) { |
113 bookmarks_->GetBookmarks(bookmarks); | 114 bookmarks_->GetBookmarks(bookmarks); |
114 } | 115 } |
115 | 116 |
116 bool HistoryBackendClientFakeBookmarks::ShouldReportDatabaseError() { | 117 bool HistoryBackendClientFakeBookmarks::ShouldReportDatabaseError() { |
117 return false; | 118 return false; |
118 } | 119 } |
119 | 120 |
| 121 bool HistoryBackendClientFakeBookmarks::IsWebSafe(const GURL& url) { |
| 122 return true; |
| 123 } |
| 124 |
120 #if defined(OS_ANDROID) | 125 #if defined(OS_ANDROID) |
121 void HistoryBackendClientFakeBookmarks::OnHistoryBackendInitialized( | 126 void HistoryBackendClientFakeBookmarks::OnHistoryBackendInitialized( |
122 HistoryBackend* history_backend, | 127 HistoryBackend* history_backend, |
123 HistoryDatabase* history_database, | 128 HistoryDatabase* history_database, |
124 ThumbnailDatabase* thumbnail_database, | 129 ThumbnailDatabase* thumbnail_database, |
125 const base::FilePath& history_dir) { | 130 const base::FilePath& history_dir) { |
126 } | 131 } |
127 | 132 |
128 void HistoryBackendClientFakeBookmarks::OnHistoryBackendDestroyed( | 133 void HistoryBackendClientFakeBookmarks::OnHistoryBackendDestroyed( |
129 HistoryBackend* history_backend, | 134 HistoryBackend* history_backend, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 void HistoryClientFakeBookmarks::NotifyProfileError( | 181 void HistoryClientFakeBookmarks::NotifyProfileError( |
177 sql::InitStatus init_status) { | 182 sql::InitStatus init_status) { |
178 } | 183 } |
179 | 184 |
180 std::unique_ptr<HistoryBackendClient> | 185 std::unique_ptr<HistoryBackendClient> |
181 HistoryClientFakeBookmarks::CreateBackendClient() { | 186 HistoryClientFakeBookmarks::CreateBackendClient() { |
182 return base::WrapUnique(new HistoryBackendClientFakeBookmarks(bookmarks_)); | 187 return base::WrapUnique(new HistoryBackendClientFakeBookmarks(bookmarks_)); |
183 } | 188 } |
184 | 189 |
185 } // namespace history | 190 } // namespace history |
OLD | NEW |