Commit b249e614 authored by Henrique Ferreiro's avatar Henrique Ferreiro Committed by Commit Bot

Migrate explore_sites_internals.mojom to the new Mojo types

Convert the implementation and all users of the
explore_sites_internals::mojom::PageHandler interface.

Bug: 955171
Change-Id: I10c6afa8c22eb3ccac5bba728cb90b4b023ebe7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1807319Reviewed-by: default avatarCathy Li <chili@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/master@{#697547}
parent fcf0fdd9
......@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.h"
#include <string>
#include <utility>
#include <vector>
#include "base/containers/flat_map.h"
......@@ -11,8 +12,11 @@
#include "chrome/browser/android/explore_sites/explore_sites_feature.h"
#include "chrome/browser/android/explore_sites/url_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom.h"
#include "components/language/core/browser/pref_names.h"
#include "components/prefs/pref_service.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
namespace explore_sites {
using chrome::android::explore_sites::ExploreSitesVariation;
......@@ -37,10 +41,10 @@ std::string GetChromeFlagsSetupString() {
} // namespace
ExploreSitesInternalsPageHandler::ExploreSitesInternalsPageHandler(
explore_sites_internals::mojom::PageHandlerRequest request,
mojo::PendingReceiver<explore_sites_internals::mojom::PageHandler> receiver,
ExploreSitesService* explore_sites_service,
Profile* profile)
: binding_(this, std::move(request)),
: receiver_(this, std::move(receiver)),
explore_sites_service_(explore_sites_service),
profile_(profile) {}
......
......@@ -8,7 +8,8 @@
#include "base/macros.h"
#include "chrome/browser/android/explore_sites/explore_sites_service.h"
#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
class Profile;
......@@ -19,7 +20,8 @@ class ExploreSitesInternalsPageHandler
: public explore_sites_internals::mojom::PageHandler {
public:
ExploreSitesInternalsPageHandler(
explore_sites_internals::mojom::PageHandlerRequest request,
mojo::PendingReceiver<explore_sites_internals::mojom::PageHandler>
receiver,
ExploreSitesService* explore_sites_service,
Profile* profile);
~ExploreSitesInternalsPageHandler() override;
......@@ -33,7 +35,7 @@ class ExploreSitesInternalsPageHandler
OverrideCountryCodeCallback) override;
void ForceNetworkRequest(ForceNetworkRequestCallback) override;
mojo::Binding<explore_sites_internals::mojom::PageHandler> binding_;
mojo::Receiver<explore_sites_internals::mojom::PageHandler> receiver_;
ExploreSitesService* explore_sites_service_;
Profile* profile_;
......
......@@ -9,10 +9,12 @@
#include "chrome/browser/android/chrome_feature_list.h"
#include "chrome/browser/android/explore_sites/explore_sites_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom.h"
#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "content/public/browser/web_ui_data_source.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
namespace explore_sites {
......@@ -44,9 +46,11 @@ ExploreSitesInternalsUI::ExploreSitesInternalsUI(content::WebUI* web_ui)
ExploreSitesInternalsUI::~ExploreSitesInternalsUI() {}
void ExploreSitesInternalsUI::BindExploreSitesInternalsPageHandler(
explore_sites_internals::mojom::PageHandlerRequest request) {
mojo::PendingReceiver<explore_sites_internals::mojom::PageHandler>
receiver) {
page_handler_ = std::make_unique<ExploreSitesInternalsPageHandler>(
std::move(request), explore_sites_service_, Profile::FromWebUI(web_ui()));
std::move(receiver), explore_sites_service_,
Profile::FromWebUI(web_ui()));
}
} // namespace explore_sites
......@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom.h"
#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "ui/webui/mojo_web_ui_controller.h"
namespace explore_sites {
......@@ -24,7 +25,8 @@ class ExploreSitesInternalsUI : public ui::MojoWebUIController {
private:
void BindExploreSitesInternalsPageHandler(
explore_sites_internals::mojom::PageHandlerRequest request);
mojo::PendingReceiver<explore_sites_internals::mojom::PageHandler>
receiver);
std::unique_ptr<ExploreSitesInternalsPageHandler> page_handler_;
ExploreSitesService* explore_sites_service_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment