| Index: chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.cc
|
| diff --git a/chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.cc b/chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.cc
|
| index e8a4f532da08dc72ce183d14171acde0925906fe..d5898852eda98ec0400974f996347a4683225447 100644
|
| --- a/chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.cc
|
| +++ b/chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.cc
|
| @@ -4,13 +4,17 @@
|
|
|
| #include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.h"
|
|
|
| +#include <utility>
|
| +
|
| #include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/ui/webui/bluetooth_internals/services/bluetooth_adapter_service.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/strong_binding.h"
|
|
|
| BluetoothInternalsUI::BluetoothInternalsUI(content::WebUI* web_ui)
|
| - : content::WebUIController(web_ui) {
|
| + : MojoWebUIController(web_ui) {
|
| // Set up the chrome://bluetooth-internals source.
|
| content::WebUIDataSource* html_source =
|
| content::WebUIDataSource::Create(chrome::kChromeUIBluetoothInternalsHost);
|
| @@ -20,6 +24,12 @@ BluetoothInternalsUI::BluetoothInternalsUI(content::WebUI* web_ui)
|
| IDR_BLUETOOTH_INTERNALS_CSS);
|
| html_source->AddResourcePath("bluetooth_internals.js",
|
| IDR_BLUETOOTH_INTERNALS_JS);
|
| + html_source->AddResourcePath(
|
| + "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals.mojom",
|
| + IDR_BLUETOOTH_INTERNALS_MOJO_JS);
|
| + html_source->AddResourcePath(
|
| + "device/bluetooth/public/interfaces/bluetooth.mojom",
|
| + IDR_BLUETOOTH_MOJO_JS);
|
| html_source->SetDefaultResource(IDR_BLUETOOTH_INTERNALS_HTML);
|
|
|
| Profile* profile = Profile::FromWebUI(web_ui);
|
| @@ -27,3 +37,17 @@ BluetoothInternalsUI::BluetoothInternalsUI(content::WebUI* web_ui)
|
| }
|
|
|
| BluetoothInternalsUI::~BluetoothInternalsUI() {}
|
| +
|
| +void BluetoothInternalsUI::BindUIHandler(
|
| + mojom::InternalsPageHandlerRequest request) {
|
| + binding_ptr_.reset(
|
| + new mojo::Binding<mojom::InternalsPageHandler>(this, std::move(request)));
|
| +}
|
| +
|
| +void BluetoothInternalsUI::GetAdapterService(
|
| + bluetooth::mojom::AdapterRequest request,
|
| + bluetooth::mojom::AdapterClientPtr client) {
|
| + mojo::MakeStrongBinding(
|
| + base::MakeUnique<BluetoothAdapterService>(std::move(client)),
|
| + std::move(request));
|
| +}
|
|
|