| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_MEDIATOR_UTIL_H_ | 5 #ifndef IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_MEDIATOR_UTIL_H_ |
| 6 #define IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_MEDIATOR_UTIL_H_ | 6 #define IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_MEDIATOR_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/optional.h" | 9 #include "base/optional.h" |
| 10 #include "components/ntp_snippets/category_info.h" | 10 #include "components/ntp_snippets/category_info.h" |
| 11 #include "components/ntp_snippets/content_suggestion.h" | 11 #include "components/ntp_snippets/content_suggestion.h" |
| 12 #include "components/ntp_snippets/status.h" | 12 #include "components/ntp_snippets/status.h" |
| 13 #include "components/ntp_tiles/ntp_tile.h" |
| 13 #import "ios/chrome/browser/ui/content_suggestions/content_suggestion.h" | 14 #import "ios/chrome/browser/ui/content_suggestions/content_suggestion.h" |
| 14 #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion
s_section_information.h" | 15 #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion
s_section_information.h" |
| 15 | 16 |
| 16 namespace ntp_snippets { | 17 namespace ntp_snippets { |
| 17 class ContentSuggestion; | 18 class ContentSuggestion; |
| 18 class Category; | 19 class Category; |
| 19 class CategoryInfo; | 20 class CategoryInfo; |
| 20 } | 21 } |
| 21 | 22 |
| 22 @class ContentSuggestionsCategoryWrapper; | 23 @class ContentSuggestionsCategoryWrapper; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 52 ContentSuggestionsSectionInformation* SectionInformationFromCategoryInfo( | 53 ContentSuggestionsSectionInformation* SectionInformationFromCategoryInfo( |
| 53 const base::Optional<ntp_snippets::CategoryInfo>& categoryInfo, | 54 const base::Optional<ntp_snippets::CategoryInfo>& categoryInfo, |
| 54 const ntp_snippets::Category& category); | 55 const ntp_snippets::Category& category); |
| 55 | 56 |
| 56 // Returns a ntp_snippets::ID based on a Objective-C Category and the ID in the | 57 // Returns a ntp_snippets::ID based on a Objective-C Category and the ID in the |
| 57 // category. | 58 // category. |
| 58 ntp_snippets::ContentSuggestion::ID SuggestionIDForSectionID( | 59 ntp_snippets::ContentSuggestion::ID SuggestionIDForSectionID( |
| 59 ContentSuggestionsCategoryWrapper* category, | 60 ContentSuggestionsCategoryWrapper* category, |
| 60 const std::string& id_in_category); | 61 const std::string& id_in_category); |
| 61 | 62 |
| 63 // Creates and returns an empty suggestion. |
| 64 ContentSuggestion* EmptySuggestion(); |
| 65 |
| 66 // Creates and returns a SectionInfo for the Most Visited section. |
| 67 ContentSuggestionsSectionInformation* MostVisitedSectionInformation(); |
| 68 |
| 69 // Records the page impression of the ntp tiles. |
| 70 void RecordPageImpression(const std::vector<ntp_tiles::NTPTile>& mostVisited); |
| 71 |
| 72 // Converts a ntp_snippets::ContentSuggestion to an Objective-C |
| 73 // ContentSuggestion. |
| 74 ContentSuggestion* ConvertNTPTile(const ntp_tiles::NTPTile& tile); |
| 75 |
| 62 #endif // IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_MEDIATOR_UTIL_H_ | 76 #endif // IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_MEDIATOR_UTIL_H_ |
| OLD | NEW |