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

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

Issue 2663313002: 📰 Merge the has_fetch_more and has_reload actions (Closed)
Patch Set: fix tests pt 2 Created 3 years, 10 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 19 matching lines...) Expand all
30 } 30 }
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, true, false, 40 ContentSuggestionsCardLayout::FULL_CARD, true,
41 true, false, 41 true, false,
Marc Treib 2017/02/01 13:33:42 Orthogonal to this CL, but since you're here: Woul
dgn 2017/02/01 18:01:52 Done.
42 base::ASCIIToUTF16("No suggestions message")); 42 base::ASCIIToUTF16("No suggestions message"));
43 } 43 }
44 44
45 void MockContentSuggestionsProvider::FireSuggestionsChanged( 45 void MockContentSuggestionsProvider::FireSuggestionsChanged(
46 Category category, 46 Category category,
47 std::vector<ContentSuggestion> suggestions) { 47 std::vector<ContentSuggestion> suggestions) {
48 observer()->OnNewSuggestions(this, category, std::move(suggestions)); 48 observer()->OnNewSuggestions(this, category, std::move(suggestions));
49 } 49 }
50 50
51 void MockContentSuggestionsProvider::FireCategoryStatusChanged( 51 void MockContentSuggestionsProvider::FireCategoryStatusChanged(
52 Category category, 52 Category category,
53 CategoryStatus new_status) { 53 CategoryStatus new_status) {
54 statuses_[category.id()] = new_status; 54 statuses_[category.id()] = new_status;
55 observer()->OnCategoryStatusChanged(this, category, new_status); 55 observer()->OnCategoryStatusChanged(this, category, new_status);
56 } 56 }
57 57
58 void MockContentSuggestionsProvider::FireCategoryStatusChangedWithCurrentStatus( 58 void MockContentSuggestionsProvider::FireCategoryStatusChangedWithCurrentStatus(
59 Category category) { 59 Category category) {
60 observer()->OnCategoryStatusChanged(this, category, statuses_[category.id()]); 60 observer()->OnCategoryStatusChanged(this, category, statuses_[category.id()]);
61 } 61 }
62 62
63 void MockContentSuggestionsProvider::FireSuggestionInvalidated( 63 void MockContentSuggestionsProvider::FireSuggestionInvalidated(
64 const ContentSuggestion::ID& suggestion_id) { 64 const ContentSuggestion::ID& suggestion_id) {
65 observer()->OnSuggestionInvalidated(this, suggestion_id); 65 observer()->OnSuggestionInvalidated(this, suggestion_id);
66 } 66 }
67 67
68 } // namespace ntp_snippets 68 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698