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

Side by Side Diff: components/ntp_snippets/mock_content_suggestions_provider.cc

Issue 2751093003: Unifies the additional actions for Categories (Closed)
Patch Set: Fix compilation on Android (hopefully) Created 3 years, 9 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 #include "components/ntp_snippets/mock_content_suggestions_provider.h" 5 #include "components/ntp_snippets/mock_content_suggestions_provider.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 20 matching lines...) Expand all
31 31
32 CategoryStatus MockContentSuggestionsProvider::GetCategoryStatus( 32 CategoryStatus MockContentSuggestionsProvider::GetCategoryStatus(
33 Category category) { 33 Category category) {
34 return statuses_[category.id()]; 34 return statuses_[category.id()];
35 } 35 }
36 36
37 CategoryInfo MockContentSuggestionsProvider::GetCategoryInfo( 37 CategoryInfo MockContentSuggestionsProvider::GetCategoryInfo(
38 Category category) { 38 Category category) {
39 return CategoryInfo(base::ASCIIToUTF16("Section title"), 39 return CategoryInfo(base::ASCIIToUTF16("Section title"),
40 ContentSuggestionsCardLayout::FULL_CARD, 40 ContentSuggestionsCardLayout::FULL_CARD,
41 /*has_fetch_action=*/true, 41 ContentSuggestionsAdditionalAction::FETCH,
42 /*has_view_all_action=*/true,
43 /*show_if_empty=*/false, 42 /*show_if_empty=*/false,
44 base::ASCIIToUTF16("No suggestions message")); 43 base::ASCIIToUTF16("No suggestions message"));
45 } 44 }
46 45
47 void MockContentSuggestionsProvider::FireSuggestionsChanged( 46 void MockContentSuggestionsProvider::FireSuggestionsChanged(
48 Category category, 47 Category category,
49 std::vector<ContentSuggestion> suggestions) { 48 std::vector<ContentSuggestion> suggestions) {
50 observer()->OnNewSuggestions(this, category, std::move(suggestions)); 49 observer()->OnNewSuggestions(this, category, std::move(suggestions));
51 } 50 }
52 51
53 void MockContentSuggestionsProvider::FireCategoryStatusChanged( 52 void MockContentSuggestionsProvider::FireCategoryStatusChanged(
54 Category category, 53 Category category,
55 CategoryStatus new_status) { 54 CategoryStatus new_status) {
56 statuses_[category.id()] = new_status; 55 statuses_[category.id()] = new_status;
57 observer()->OnCategoryStatusChanged(this, category, new_status); 56 observer()->OnCategoryStatusChanged(this, category, new_status);
58 } 57 }
59 58
60 void MockContentSuggestionsProvider::FireCategoryStatusChangedWithCurrentStatus( 59 void MockContentSuggestionsProvider::FireCategoryStatusChangedWithCurrentStatus(
61 Category category) { 60 Category category) {
62 observer()->OnCategoryStatusChanged(this, category, statuses_[category.id()]); 61 observer()->OnCategoryStatusChanged(this, category, statuses_[category.id()]);
63 } 62 }
64 63
65 void MockContentSuggestionsProvider::FireSuggestionInvalidated( 64 void MockContentSuggestionsProvider::FireSuggestionInvalidated(
66 const ContentSuggestion::ID& suggestion_id) { 65 const ContentSuggestion::ID& suggestion_id) {
67 observer()->OnSuggestionInvalidated(this, suggestion_id); 66 observer()->OnSuggestionInvalidated(this, suggestion_id);
68 } 67 }
69 68
70 } // namespace ntp_snippets 69 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698