1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_NETWORK_NETWORK_CONNECTION_OBSERVER_H_
6 #define CHROMEOS_NETWORK_NETWORK_CONNECTION_OBSERVER_H_
10 #include "base/macros.h"
11 #include "chromeos/chromeos_export.h"
15 // Observer class for network connection events.
16 class CHROMEOS_EXPORT NetworkConnectionObserver
{
18 NetworkConnectionObserver();
20 // Called when a connection to network |service_path| is requested by
21 // calling NetworkConnectionHandler::ConnectToNetwork.
22 virtual void ConnectToNetworkRequested(const std::string
& service_path
);
24 // Called when a connection request succeeds.
25 virtual void ConnectSucceeded(const std::string
& service_path
);
27 // Called when a connection request fails. Valid error names are defined in
28 // NetworkConnectionHandler.
29 virtual void ConnectFailed(const std::string
& service_path
,
30 const std::string
& error_name
);
32 // Called when a disconnect to network |service_path| is requested by
33 // calling NetworkConnectionHandler::DisconnectNetwork. Success or failure
34 // for disconnect is not tracked here, observe NetworkStateHandler for state
36 virtual void DisconnectRequested(const std::string
& service_path
);
39 virtual ~NetworkConnectionObserver();
42 DISALLOW_COPY_AND_ASSIGN(NetworkConnectionObserver
);
45 } // namespace chromeos
47 #endif // CHROMEOS_NETWORK_NETWORK_CONNECTION_OBSERVER_H_