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

Unified Diff: chrome/browser/ui/webui/snippets_internals_message_handler.h

Issue 2569663004: [NTPSnippets] Switch from TickClock to Clock for storing the last background fetched time. (Closed)
Patch Set: Add a DCHECK to check that the num or args passed to the new method is 0 Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/snippets_internals_message_handler.h
diff --git a/chrome/browser/ui/webui/snippets_internals_message_handler.h b/chrome/browser/ui/webui/snippets_internals_message_handler.h
index d6911cfe20d8a3fce0bbe9dff2fdca72f55a034d..6823b5c045852f5ad695e9b5b17b447ac7ee57e4 100644
--- a/chrome/browser/ui/webui/snippets_internals_message_handler.h
+++ b/chrome/browser/ui/webui/snippets_internals_message_handler.h
@@ -22,12 +22,20 @@ namespace base {
class ListValue;
} // namespace base
+namespace ntp_snippets {
+class ContentSuggestionsService;
+} // namespace ntp_snippets
+
+class PrefService;
+
// The implementation for the chrome://snippets-internals page.
class SnippetsInternalsMessageHandler
: public content::WebUIMessageHandler,
public ntp_snippets::ContentSuggestionsService::Observer {
public:
- SnippetsInternalsMessageHandler();
+ SnippetsInternalsMessageHandler(
+ ntp_snippets::ContentSuggestionsService* content_suggestions_service,
+ PrefService* pref_service);
~SnippetsInternalsMessageHandler() override;
private:
@@ -52,9 +60,11 @@ class SnippetsInternalsMessageHandler
void HandleClearDismissedSuggestions(const base::ListValue* args);
void HandleToggleDismissedSuggestions(const base::ListValue* args);
void ClearClassification(const base::ListValue* args);
+ void FetchRemoteSuggestionsInTheBackground(const base::ListValue* args);
void SendAllContent();
void SendClassification();
+ void SendLastRemoteSuggestionsBackgroundFetchTime();
void SendContentSuggestions();
void SendBoolean(const std::string& name, bool value);
void SendString(const std::string& name, const std::string& value);
@@ -70,8 +80,9 @@ class SnippetsInternalsMessageHandler
// Tracks whether we can already send messages to the page.
bool dom_loaded_;
- ntp_snippets::RemoteSuggestionsProvider* ntp_snippets_service_;
ntp_snippets::ContentSuggestionsService* content_suggestions_service_;
+ ntp_snippets::RemoteSuggestionsProvider* remote_suggestions_provider_;
+ PrefService* pref_service_;
std::map<ntp_snippets::Category,
DismissedState,
« no previous file with comments | « chrome/browser/resources/snippets_internals.js ('k') | chrome/browser/ui/webui/snippets_internals_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698