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

Unified Diff: components/ntp_snippets/category_rankers/fake_category_ranker.h

Issue 2581163004: [NTP::SectionOrder] Propagate new order through ContentSuggestionsService. (Closed)
Patch Set: treib@ nits. Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ntp_snippets/BUILD.gn ('k') | components/ntp_snippets/category_rankers/fake_category_ranker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/category_rankers/fake_category_ranker.h
diff --git a/components/ntp_snippets/category_rankers/fake_category_ranker.h b/components/ntp_snippets/category_rankers/fake_category_ranker.h
new file mode 100644
index 0000000000000000000000000000000000000000..9093f07bda7ab26c4cfb48b3393bb467b9ddb221
--- /dev/null
+++ b/components/ntp_snippets/category_rankers/fake_category_ranker.h
@@ -0,0 +1,38 @@
+// Copyright 2016 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_NTP_SNIPPETS_CATEGORY_RANKERS_FAKE_CATEGORY_RANKER_H_
+#define COMPONENTS_NTP_SNIPPETS_CATEGORY_RANKERS_FAKE_CATEGORY_RANKER_H_
+
+#include <vector>
+
+#include "base/time/time.h"
+#include "components/ntp_snippets/category.h"
+#include "components/ntp_snippets/category_rankers/category_ranker.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace ntp_snippets {
+
+class FakeCategoryRanker : public CategoryRanker {
+ public:
+ FakeCategoryRanker();
+ ~FakeCategoryRanker() override;
+
+ void SetOrder(const std::vector<Category>& new_order) {
+ categories_ = new_order;
+ }
+
+ // CategoryRanker implementation.
+ bool Compare(Category left, Category right) const override;
+ void ClearHistory(base::Time begin, base::Time end) override;
+ void AppendCategoryIfNecessary(Category category) override;
+ void OnSuggestionOpened(Category category) override;
+
+ private:
+ std::vector<Category> categories_;
+};
+
+} // namespace ntp_snippets
+
+#endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_RANKERS_FAKE_CATEGORY_RANKER_H_
« no previous file with comments | « components/ntp_snippets/BUILD.gn ('k') | components/ntp_snippets/category_rankers/fake_category_ranker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698