chromium/services/network/network_change_manager.h

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

#ifndef SERVICES_NETWORK_NETWORK_CHANGE_MANAGER_H_
#define SERVICES_NETWORK_NETWORK_CHANGE_MANAGER_H_

#include <memory>
#include <vector>

#include "base/component_export.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/base/network_change_notifier.h"
#include "services/network/public/mojom/network_change_manager.mojom.h"

#if BUILDFLAG(IS_LINUX)
#include "services/network/public/mojom/network_interface_change_listener.mojom.h"
#endif

namespace network {

// Implementation of mojom::NetworkChangeManager. All accesses to this class are
// done through mojo on the main thread. This registers itself to receive
// broadcasts from net::NetworkChangeNotifier and rebroadcasts the notifications
// to mojom::NetworkChangeManagerClients through mojo pipes.
class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkChangeManager
    : public mojom::NetworkChangeManager,
      public net::NetworkChangeNotifier::NetworkChangeObserver
#if BUILDFLAG(IS_LINUX)
    ,
      public mojom::NetworkInterfaceChangeListener
#endif
{};

}  // namespace network

#endif  // SERVICES_NETWORK_NETWORK_CHANGE_MANAGER_H_