OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ntp_snippets/content_suggestions_provider.h" | 5 #include "components/ntp_snippets/content_suggestions_provider.h" |
6 | 6 |
7 #include "components/ntp_snippets/category_factory.h" | 7 #include "components/ntp_snippets/category_factory.h" |
8 | 8 |
9 namespace ntp_snippets { | 9 namespace ntp_snippets { |
10 | 10 |
11 ContentSuggestionsProvider::ContentSuggestionsProvider( | 11 ContentSuggestionsProvider::ContentSuggestionsProvider( |
12 Observer* observer, | 12 Observer* observer, |
13 CategoryFactory* category_factory) | 13 CategoryFactory* category_factory) |
14 : observer_(observer), category_factory_(category_factory) {} | 14 : observer_(observer), category_factory_(category_factory) {} |
15 | 15 |
16 ContentSuggestionsProvider::~ContentSuggestionsProvider() = default; | 16 ContentSuggestionsProvider::~ContentSuggestionsProvider() = default; |
17 | 17 |
18 std::string ContentSuggestionsProvider::MakeUniqueID( | |
19 Category category, | |
20 const std::string& within_category_id) const { | |
21 return category_factory()->MakeUniqueID(category, within_category_id); | |
22 } | |
23 | |
24 Category ContentSuggestionsProvider::GetCategoryFromUniqueID( | |
25 const std::string& unique_id) const { | |
26 return category_factory()->GetCategoryFromUniqueID(unique_id); | |
27 } | |
28 | |
29 std::string ContentSuggestionsProvider::GetWithinCategoryIDFromUniqueID( | |
30 const std::string& unique_id) const { | |
31 return category_factory()->GetWithinCategoryIDFromUniqueID(unique_id); | |
32 } | |
33 | |
34 } // namespace ntp_snippets | 18 } // namespace ntp_snippets |
OLD | NEW |