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 #ifndef COMPONENTS_NTP_SNIPPETS_CATEGORY_FACTORY_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_CATEGORY_FACTORY_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_CATEGORY_FACTORY_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_CATEGORY_FACTORY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "components/ntp_snippets/category.h" | 12 #include "components/ntp_snippets/category.h" |
13 | 13 |
14 namespace ntp_snippets { | 14 namespace ntp_snippets { |
15 | 15 |
16 // Creates and orders Category instancesCategory. | 16 // Creates and orders Category instances. |
17 class CategoryFactory { | 17 class CategoryFactory { |
18 public: | 18 public: |
19 CategoryFactory(); | 19 CategoryFactory(); |
20 ~CategoryFactory(); | 20 ~CategoryFactory(); |
21 | 21 |
22 // Creates a category from a KnownCategory value. The passed |known_category| | 22 // Creates a category from a KnownCategory value. The passed |known_category| |
23 // must not be one of the special values (LOCAL_CATEGORIES_COUNT or | 23 // must not be one of the special values (LOCAL_CATEGORIES_COUNT or |
24 // REMOTE_CATEGORIES_OFFSET). | 24 // REMOTE_CATEGORIES_OFFSET). |
25 Category FromKnownCategory(KnownCategories known_category); | 25 Category FromKnownCategory(KnownCategories known_category); |
26 | 26 |
(...skipping 24 matching lines...) Expand all Loading... |
51 // Stores all known categories in the order which is also returned by | 51 // Stores all known categories in the order which is also returned by |
52 // |CompareCategories|. | 52 // |CompareCategories|. |
53 std::vector<Category> ordered_categories_; | 53 std::vector<Category> ordered_categories_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(CategoryFactory); | 55 DISALLOW_COPY_AND_ASSIGN(CategoryFactory); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace ntp_snippets | 58 } // namespace ntp_snippets |
59 | 59 |
60 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_FACTORY_H_ | 60 #endif // COMPONENTS_NTP_SNIPPETS_CATEGORY_FACTORY_H_ |
OLD | NEW |