Repository: electron/electron
File: shell/browser/electron_permission_manager.cc (C++)

Code before:
void ElectronPermissionManager::SetPermissionCheckHandler(
    const CheckHandler& handler) {
  check_handler_ = handler;
}

void ElectronPermissionManager::SetDevicePermissionHandler(
    const DeviceCheckHandler& handler) {
  device_permission_handler_ = handler;
}

void ElectronPermissionManager::SetProtectedUSBHandler(
    const ProtectedUSBHandler& handler) {
  protected_usb_handler_ = handler;
}

void ElectronPermissionManager::SetBluetoothPairingHandler(
    const BluetoothPairingHandler& handler) {
  bluetooth_pairing_handler_ = handler;
}

bool ElectronPermissionManager::IsGeolocationDisabledViaCommandLine() {
// Remove platform check once flag is extended to other platforms
#if BUILDFLAG(IS_MAC)
  auto* command_line = base::CommandLine::ForCurrentProcess();
  return command_line->HasSwitch("disable-geolocation");
#else
  return false;
#endif
}

void ElectronPermissionManager::RequestPermissionWithDetails(
    blink::mojom::PermissionDescriptorPtr permission,
    content::RenderFrameHost* render_frame_host,
    const GURL& requesting_origin,
    bool user_gesture,
    base::Value::Dict details,
    StatusCallback response_callback) {
  if (render_frame_host->IsNestedWithinFencedFrame()) {
    std::move(response_callback).Run(blink::mojom::PermissionStatus::DENIED);
    return;
  }

  RequestPermissionsWithDetails(
      render_frame_host,
      content::PermissionRequestDescription(std::move(permission), user_gesture,
                                            requesting_origin),
      std::move(details),
      base::BindOnce(PermissionRequestResponseCallbackWrapper,
                     std::move(response_callback)));
}


Review comment (bug):
```suggestion
// static
bool ElectronPermissionManager::IsGeolocationDisabledViaCommandLine() {
```

nit: static members should have comment `// static` in the implementation.

Code after:
  }
  request_handler_ = handler;
}

void ElectronPermissionManager::SetPermissionCheckHandler(
    const CheckHandler& handler) {
  check_handler_ = handler;
}

void ElectronPermissionManager::SetDevicePermissionHandler(
    const DeviceCheckHandler& handler) {
  device_permission_handler_ = handler;
}

void ElectronPermissionManager::SetProtectedUSBHandler(
    const ProtectedUSBHandler& handler) {
  protected_usb_handler_ = handler;
}

void ElectronPermissionManager::SetBluetoothPairingHandler(
    const BluetoothPairingHandler& handler) {
  bluetooth_pairing_handler_ = handler;
}

// static
bool ElectronPermissionManager::IsGeolocationDisabledViaCommandLine() {
// Remove platform check once flag is extended to other platforms
#if BUILDFLAG(IS_MAC)
  auto* command_line = base::CommandLine::ForCurrentProcess();
  return command_line->HasSwitch("disable-geolocation");
#else
  return false;
#endif
}

bool ElectronPermissionManager::HasPermissionRequestHandler() const {
  return !request_handler_.is_null();
}

bool ElectronPermissionManager::HasPermissionCheckHandler() const {
  return !check_handler_.is_null();
}

void ElectronPermissionManager::RequestPermissionWithDetails(
    blink::mojom::PermissionDescriptorPtr permission,
    content::RenderFrameHost* render_frame_host,
    const GURL& requesting_origin,
    bool user_gesture,
    base::Value::Dict details,
    StatusCallback response_callback) {
  if (render_frame_host->IsNestedWithinFencedFrame()) {