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

Side by Side Diff: ios/chrome/browser/content_suggestions/mediator_util.h

Issue 2798563002: Add MostVistedSites to ContentSuggestionsMediator (Closed)
Patch Set: Reviewable Created 3 years, 8 months 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 unified diff | Download patch
OLDNEW
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
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 suggestions.
lpromero 2017/04/04 11:25:20 *suggestion
gambard 2017/04/04 16:14:26 Done.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698