chromium/chrome/browser/private_network_access/chrome_private_network_device_delegate.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/private_network_access/chrome_private_network_device_delegate.h"

#include "base/metrics/histogram_functions.h"
#include "base/observer_list.h"
#include "base/observer_list_types.h"
#include "base/scoped_observation.h"
#include "chrome/browser/private_network_access/chrome_private_network_device_chooser_desktop.h"
#include "chrome/browser/private_network_access/private_network_device_chooser_controller.h"
#include "chrome/browser/private_network_access/private_network_device_permission_context.h"
#include "chrome/browser/private_network_access/private_network_device_permission_context_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/console_message.h"
#include "content/public/browser/render_frame_host.h"
#include "services/network/public/mojom/url_loader_network_service_observer.mojom.h"
#include "third_party/re2/src/re2/re2.h"

ChromePrivateNetworkDeviceDelegate::ChromePrivateNetworkDeviceDelegate() =
    default;
ChromePrivateNetworkDeviceDelegate::~ChromePrivateNetworkDeviceDelegate() =
    default;

void ChromePrivateNetworkDeviceDelegate::RequestPermission(
    content::RenderFrameHost& frame,
    blink::mojom::PrivateNetworkDevicePtr device,
    network::mojom::URLLoaderNetworkServiceObserver::
        OnPrivateNetworkAccessPermissionRequiredCallback callback) {}

bool ChromePrivateNetworkDeviceDelegate::CheckDevice(
    const blink::mojom::PrivateNetworkDevice& device,
    content::RenderFrameHost& frame) {}

bool ChromePrivateNetworkDeviceDelegate::HasDevicePermission(
    content::RenderFrameHost& frame,
    const blink::mojom::PrivateNetworkDevice& device,
    bool is_device_valid) {}

std::unique_ptr<ChromePrivateNetworkDeviceChooser>
ChromePrivateNetworkDeviceDelegate::RunChooser(
    content::RenderFrameHost& frame,
    blink::mojom::PrivateNetworkDevicePtr device,
    network::mojom::URLLoaderNetworkServiceObserver::
        OnPrivateNetworkAccessPermissionRequiredCallback callback,
    bool is_device_valid) {}

PrivateNetworkDevicePermissionContext*
ChromePrivateNetworkDeviceDelegate::GetPermissionContext(
    content::BrowserContext* browser_context) {}

void ChromePrivateNetworkDeviceDelegate::
    HandlePrivateNetworkDeviceChooserResult(
        bool is_device_valid,
        network::mojom::URLLoaderNetworkServiceObserver::
            OnPrivateNetworkAccessPermissionRequiredCallback callback,
        PrivateNetworkDevicePermissionContext* permission_context,
        const url::Origin& origin,
        const blink::mojom::PrivateNetworkDevice& device,
        bool permission_granted) {}