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

Unified Diff: components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h

Issue 2572133002: Add more features to ntp-tiles-internal (Closed)
Patch Set: address comments 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: components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h
diff --git a/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h b/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h
index 23727465e8450faa656fd557caa4f180916241f8..3d99b949733180ffd841d59e155768ed58e5cf18 100644
--- a/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h
+++ b/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/optional.h"
#include "components/ntp_tiles/most_visited_sites.h"
namespace base {
@@ -39,9 +40,12 @@ class NTPTilesInternalsMessageHandler : public MostVisitedSites::Observer {
// Callbacks registered in RegisterMessages().
void HandleRegisterForEvents(const base::ListValue* args);
void HandleUpdate(const base::ListValue* args);
+ void HandleFetchSuggestions(const base::ListValue* args);
+ void HandleViewPopularSitesJson(const base::ListValue* args);
void SendSourceInfo();
void SendTiles(const NTPTilesVector& tiles);
+ void PopularSitesJsonRead(const base::Optional<std::string>& content);
// MostVisitedSites::Observer.
void OnMostVisitedURLsAvailable(const NTPTilesVector& tiles) override;
@@ -53,6 +57,11 @@ class NTPTilesInternalsMessageHandler : public MostVisitedSites::Observer {
int site_count_;
std::unique_ptr<MostVisitedSites> most_visited_sites_;
+ std::string suggestions_status_;
+ std::string popular_sites_json_;
+
+ base::WeakPtrFactory<NTPTilesInternalsMessageHandler> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(NTPTilesInternalsMessageHandler);
};

Powered by Google App Engine
This is Rietveld 408576698