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

Side by Side Diff: components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.h

Issue 2669533002: [NTP::PhysicalWeb] In OnLost invalidate by |resolved_url|. (Closed)
Patch Set: 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 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_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTIONS _PROVIDER_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTIONS _PROVIDER_H_
6 #define COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTIONS _PROVIDER_H_ 6 #define COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTIONS _PROVIDER_H_
7 7
8 #include <map>
8 #include <set> 9 #include <set>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
12 #include "components/ntp_snippets/category.h" 13 #include "components/ntp_snippets/category.h"
13 #include "components/ntp_snippets/category_status.h" 14 #include "components/ntp_snippets/category_status.h"
14 #include "components/ntp_snippets/content_suggestion.h" 15 #include "components/ntp_snippets/content_suggestion.h"
15 #include "components/ntp_snippets/content_suggestions_provider.h" 16 #include "components/ntp_snippets/content_suggestions_provider.h"
16 #include "components/physical_web/data_source/physical_web_listener.h" 17 #include "components/physical_web/data_source/physical_web_listener.h"
17 18
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // PhysicalWebListener implementation. 84 // PhysicalWebListener implementation.
84 void OnFound(const GURL& url) override; 85 void OnFound(const GURL& url) override;
85 void OnLost(const GURL& url) override; 86 void OnLost(const GURL& url) override;
86 void OnDistanceChanged(const GURL& url, double distance_estimate) override; 87 void OnDistanceChanged(const GURL& url, double distance_estimate) override;
87 88
88 // Fires the |OnSuggestionInvalidated| event for the suggestion corresponding 89 // Fires the |OnSuggestionInvalidated| event for the suggestion corresponding
89 // to the given |page_id| and deletes it from the dismissed IDs list, if 90 // to the given |page_id| and deletes it from the dismissed IDs list, if
90 // necessary. 91 // necessary.
91 void InvalidateSuggestion(const std::string& page_id); 92 void InvalidateSuggestion(const std::string& page_id);
92 93
94 void AppendToShownScannedUrls(
95 const std::vector<ContentSuggestion>& suggestions);
96
93 // Reads dismissed IDs from Prefs. 97 // Reads dismissed IDs from Prefs.
94 std::set<std::string> ReadDismissedIDsFromPrefs() const; 98 std::set<std::string> ReadDismissedIDsFromPrefs() const;
95 99
96 // Writes |dismissed_ids| into Prefs. 100 // Writes |dismissed_ids| into Prefs.
97 void StoreDismissedIDsToPrefs(const std::set<std::string>& dismissed_ids); 101 void StoreDismissedIDsToPrefs(const std::set<std::string>& dismissed_ids);
98 102
103 std::multimap<GURL, GURL> shown_scanned_urls_;
Marc Treib 2017/01/31 11:02:41 Map from what to what? Can we add a comment and/or
vitaliii 2017/01/31 12:33:49 Done. I went for a clearer name.
99 CategoryStatus category_status_; 104 CategoryStatus category_status_;
100 const Category provided_category_; 105 const Category provided_category_;
101 physical_web::PhysicalWebDataSource* physical_web_data_source_; 106 physical_web::PhysicalWebDataSource* physical_web_data_source_;
102 PrefService* pref_service_; 107 PrefService* pref_service_;
103 108
104 DISALLOW_COPY_AND_ASSIGN(PhysicalWebPageSuggestionsProvider); 109 DISALLOW_COPY_AND_ASSIGN(PhysicalWebPageSuggestionsProvider);
105 }; 110 };
106 111
107 } // namespace ntp_snippets 112 } // namespace ntp_snippets
108 113
109 #endif // COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTI ONS_PROVIDER_H_ 114 #endif // COMPONENTS_NTP_SNIPPETS_PHYSICAL_WEB_PAGES_PHYSICAL_WEB_PAGE_SUGGESTI ONS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698