Commit 121bae55 authored by Miyoung Shin's avatar Miyoung Shin Committed by Commit Bot

Convert BluetoothInternalsHandler to new Mojo types

This CL converts BluetoothInternalsHandlerRequest in chrome to
the new Mojo type.

Bug: 955171
Change-Id: I5a04f8653dbc53022ff52171fc2569a373c5743e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1788768
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarcalamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694730}
parent 080c38d4
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "url/gurl.h" #include "url/gurl.h"
BluetoothInternalsHandler::BluetoothInternalsHandler( BluetoothInternalsHandler::BluetoothInternalsHandler(
mojom::BluetoothInternalsHandlerRequest request) mojo::PendingReceiver<mojom::BluetoothInternalsHandler> receiver)
: binding_(this, std::move(request)) {} : receiver_(this, std::move(receiver)) {}
BluetoothInternalsHandler::~BluetoothInternalsHandler() {} BluetoothInternalsHandler::~BluetoothInternalsHandler() {}
......
...@@ -8,14 +8,15 @@ ...@@ -8,14 +8,15 @@
#include "base/macros.h" #include "base/macros.h"
#include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals.mojom.h" #include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals.mojom.h"
#include "device/bluetooth/bluetooth_adapter.h" #include "device/bluetooth/bluetooth_adapter.h"
#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
// Handles API requests from chrome://bluetooth-internals page by implementing // Handles API requests from chrome://bluetooth-internals page by implementing
// mojom::BluetoothInternalsHandler. // mojom::BluetoothInternalsHandler.
class BluetoothInternalsHandler : public mojom::BluetoothInternalsHandler { class BluetoothInternalsHandler : public mojom::BluetoothInternalsHandler {
public: public:
explicit BluetoothInternalsHandler( explicit BluetoothInternalsHandler(
mojom::BluetoothInternalsHandlerRequest request); mojo::PendingReceiver<mojom::BluetoothInternalsHandler> receiver);
~BluetoothInternalsHandler() override; ~BluetoothInternalsHandler() override;
// mojom::BluetoothInternalsHandler overrides: // mojom::BluetoothInternalsHandler overrides:
...@@ -25,7 +26,7 @@ class BluetoothInternalsHandler : public mojom::BluetoothInternalsHandler { ...@@ -25,7 +26,7 @@ class BluetoothInternalsHandler : public mojom::BluetoothInternalsHandler {
void OnGetAdapter(GetAdapterCallback callback, void OnGetAdapter(GetAdapterCallback callback,
scoped_refptr<device::BluetoothAdapter> adapter); scoped_refptr<device::BluetoothAdapter> adapter);
mojo::Binding<mojom::BluetoothInternalsHandler> binding_; mojo::Receiver<mojom::BluetoothInternalsHandler> receiver_;
base::WeakPtrFactory<BluetoothInternalsHandler> weak_ptr_factory_{this}; base::WeakPtrFactory<BluetoothInternalsHandler> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(BluetoothInternalsHandler); DISALLOW_COPY_AND_ASSIGN(BluetoothInternalsHandler);
......
...@@ -43,7 +43,7 @@ BluetoothInternalsUI::BluetoothInternalsUI(content::WebUI* web_ui) ...@@ -43,7 +43,7 @@ BluetoothInternalsUI::BluetoothInternalsUI(content::WebUI* web_ui)
BluetoothInternalsUI::~BluetoothInternalsUI() {} BluetoothInternalsUI::~BluetoothInternalsUI() {}
void BluetoothInternalsUI::BindBluetoothInternalsHandler( void BluetoothInternalsUI::BindBluetoothInternalsHandler(
mojom::BluetoothInternalsHandlerRequest request) { mojo::PendingReceiver<mojom::BluetoothInternalsHandler> receiver) {
page_handler_ = page_handler_ =
std::make_unique<BluetoothInternalsHandler>(std::move(request)); std::make_unique<BluetoothInternalsHandler>(std::move(receiver));
} }
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals.mojom.h" #include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "ui/webui/mojo_web_ui_controller.h" #include "ui/webui/mojo_web_ui_controller.h"
class BluetoothInternalsHandler; class BluetoothInternalsHandler;
...@@ -19,7 +20,7 @@ class BluetoothInternalsUI : public ui::MojoWebUIController { ...@@ -19,7 +20,7 @@ class BluetoothInternalsUI : public ui::MojoWebUIController {
private: private:
void BindBluetoothInternalsHandler( void BindBluetoothInternalsHandler(
mojom::BluetoothInternalsHandlerRequest request); mojo::PendingReceiver<mojom::BluetoothInternalsHandler> receiver);
std::unique_ptr<BluetoothInternalsHandler> page_handler_; std::unique_ptr<BluetoothInternalsHandler> page_handler_;
......
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