Skip to content

Commit

Permalink
removing logging
Browse files Browse the repository at this point in the history
  • Loading branch information
John Kleinschmidt committed Sep 14, 2022
1 parent d35cf25 commit 289d50c
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions shell/browser/bluetooth/electron_bluetooth_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,27 @@ std::unique_ptr<content::BluetoothScanningPrompt>
ElectronBluetoothDelegate::ShowBluetoothScanningPrompt(
content::RenderFrameHost* frame,
const content::BluetoothScanningPrompt::EventHandler& event_handler) {
LOG(INFO) << "In ElectronBluetoothDelegate::ShowBluetoothScanningPrompt";
NOTIMPLEMENTED();
return nullptr;
}

WebBluetoothDeviceId ElectronBluetoothDelegate::GetWebBluetoothDeviceId(
RenderFrameHost* frame,
const std::string& device_address) {
LOG(INFO) << "In ElectronBluetoothDelegate::GetWebBluetoothDeviceId";
NOTIMPLEMENTED();
return WebBluetoothDeviceId::Create();
}

std::string ElectronBluetoothDelegate::GetDeviceAddress(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id) {
LOG(INFO) << "In ElectronBluetoothDelegate::GetDeviceAddress";
NOTIMPLEMENTED();
return nullptr;
}

WebBluetoothDeviceId ElectronBluetoothDelegate::AddScannedDevice(
RenderFrameHost* frame,
const std::string& device_address) {
LOG(INFO) << "In ElectronBluetoothDelegate::AddScannedDevice";
NOTIMPLEMENTED();
return WebBluetoothDeviceId::Create();
}
Expand All @@ -105,24 +101,20 @@ WebBluetoothDeviceId ElectronBluetoothDelegate::GrantServiceAccessPermission(
RenderFrameHost* frame,
const device::BluetoothDevice* device,
const blink::mojom::WebBluetoothRequestDeviceOptions* options) {
LOG(INFO) << "In ElectronBluetoothDelegate::GrantServiceAccessPermission";
NOTIMPLEMENTED();
return WebBluetoothDeviceId::Create();
}

bool ElectronBluetoothDelegate::HasDevicePermission(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id) {
LOG(INFO) << "In ElectronBluetoothDelegate::HasDevicePermission";
NOTIMPLEMENTED();
return true;
}

void ElectronBluetoothDelegate::RevokeDevicePermissionWebInitiated(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id) {
LOG(INFO)
<< "In ElectronBluetoothDelegate::RevokeDevicePermissionWebInitiated";
NOTIMPLEMENTED();
}

Expand All @@ -137,8 +129,6 @@ bool ElectronBluetoothDelegate::IsAllowedToAccessService(
bool ElectronBluetoothDelegate::IsAllowedToAccessAtLeastOneService(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id) {
LOG(INFO)
<< "In ElectronBluetoothDelegate::IsAllowedToAccessAtLeastOneService";
NOTIMPLEMENTED();
return true;
}
Expand All @@ -147,8 +137,6 @@ bool ElectronBluetoothDelegate::IsAllowedToAccessManufacturerData(
RenderFrameHost* frame,
const WebBluetoothDeviceId& device_id,
uint16_t manufacturer_code) {
LOG(INFO)
<< "In ElectronBluetoothDelegate::IsAllowedToAccessManufacturerData";
NOTIMPLEMENTED();
return true;
}
Expand All @@ -167,7 +155,6 @@ std::vector<blink::mojom::WebBluetoothDevicePtr>
ElectronBluetoothDelegate::GetPermittedDevices(
content::RenderFrameHost* frame) {
std::vector<blink::mojom::WebBluetoothDevicePtr> permitted_devices;
LOG(INFO) << "In ElectronBluetoothDelegate:::GetPermittedDevices";
NOTIMPLEMENTED();
return permitted_devices;
}
Expand All @@ -178,15 +165,12 @@ void ElectronBluetoothDelegate::ShowDevicePairPrompt(
PairPromptCallback callback,
PairingKind pairing_kind,
const absl::optional<std::u16string>& pin) {
LOG(INFO) << "In ElectronBluetoothDelegate::ShowDevicePairPrompt";
pair_prompt_callback_ = std::move(callback);

bool prevent_default = false;

auto* web_contents = content::WebContents::FromRenderFrameHost(frame);
if (web_contents) {
LOG(INFO) << "In ElectronBluetoothDelegate::ShowDevicePairPrompt, got web "
"contents; now get session";
api::Session* session =
api::Session::FromBrowserContext(web_contents->GetBrowserContext());
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
Expand All @@ -199,17 +183,13 @@ void ElectronBluetoothDelegate::ShowDevicePairPrompt(
if (pin.has_value()) {
details.Set("pin", pin.value());
}
LOG(INFO) << "In ElectronBluetoothDelegate::ShowDevicePairPrompt, emitting "
"'bluetooth-pair-prompt'";
prevent_default = session->Emit(
"bluetooth-pair-prompt", details,
base::AdaptCallbackForRepeating(base::BindOnce(
&ElectronBluetoothDelegate::OnDevicePairPromptResponse,
weak_factory_.GetWeakPtr())));

if (!prevent_default) {
LOG(INFO) << "In ElectronBluetoothDelegate::ShowDevicePairPrompt, "
"prevent_default is false so cancel the pair prompt";
std::move(pair_prompt_callback_)
.Run(BluetoothDelegate::PairPromptResult(
BluetoothDelegate::PairPromptStatus::kCancelled));
Expand All @@ -220,8 +200,6 @@ void ElectronBluetoothDelegate::ShowDevicePairPrompt(
void ElectronBluetoothDelegate::OnDevicePairPromptResponse(
gin::Arguments* args) {
BluetoothDelegate::PairPromptResult result;
LOG(INFO) << "In ElectronBluetoothDelegate::OnDevicePairPromptResponse(, "
"prevent_default is false so cancel the pair prompt";
bool confirmed;
std::u16string pin;
if (args->GetNext(&confirmed) && confirmed) {
Expand Down

0 comments on commit 289d50c

Please sign in to comment.