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

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

Issue 2457033003: Add chrome://popular-sites-internals/ to iOS. (Closed)
Patch Set: Inline message handler impl. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/popular_sites_internals_message_handler.h
diff --git a/chrome/browser/ui/webui/popular_sites_internals_message_handler.h b/chrome/browser/ui/webui/popular_sites_internals_message_handler.h
index 700de05e6b5e2a5d568ca270b5e99ceeb7118dd9..78353707751e4679574660bac85d9c86a41d3db2 100644
--- a/chrome/browser/ui/webui/popular_sites_internals_message_handler.h
+++ b/chrome/browser/ui/webui/popular_sites_internals_message_handler.h
@@ -9,20 +9,13 @@
#include <string>
#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
+#include "components/ntp_tiles/webui/popular_sites_handler.h"
#include "content/public/browser/web_ui_message_handler.h"
-namespace base {
-class ListValue;
-} // namespace base
-
-namespace ntp_tiles {
-class PopularSites;
-} // namespace ntp_tiles
-
// The implementation for the chrome://popular-sites-internals page.
class PopularSitesInternalsMessageHandler
- : public content::WebUIMessageHandler {
+ : public content::WebUIMessageHandler,
+ public ntp_tiles::PopularSitesInternalsMessageHandlerInterface {
public:
PopularSitesInternalsMessageHandler();
~PopularSitesInternalsMessageHandler() override;
@@ -31,20 +24,18 @@ class PopularSitesInternalsMessageHandler
// content::WebUIMessageHandler:
void RegisterMessages() override;
- void HandleRegisterForEvents(const base::ListValue* args);
- void HandleUpdate(const base::ListValue* args);
- void HandleViewJson(const base::ListValue* args);
-
- void SendOverrides();
- void SendDownloadResult(bool success);
- void SendSites();
- void SendJson(const std::string& json);
-
- void OnPopularSitesAvailable(bool explicit_request, bool success);
-
- std::unique_ptr<ntp_tiles::PopularSites> popular_sites_;
-
- base::WeakPtrFactory<PopularSitesInternalsMessageHandler> weak_ptr_factory_;
+ // PopularSitesInternalsMessageHandlerInterface
+ base::SequencedWorkerPool* GetBlockingPool() override;
+ std::unique_ptr<ntp_tiles::PopularSites> MakePopularSites() override;
+ PrefService* GetPrefs() override;
+ void RegisterMessageCallback(
+ const std::string& message,
+ const base::Callback<void(const base::ListValue*)>& callback) override;
+ void CallJavascriptFunctionVector(
+ const std::string& name,
+ const std::vector<const base::Value*>& values) override;
+
+ ntp_tiles::PopularSitesInternalsMessageHandlerImpl impl_;
DISALLOW_COPY_AND_ASSIGN(PopularSitesInternalsMessageHandler);
};

Powered by Google App Engine
This is Rietveld 408576698