| Index: chromeos/network/managed_network_configuration_handler.h
|
| diff --git a/chromeos/network/network_configuration_handler.h b/chromeos/network/managed_network_configuration_handler.h
|
| similarity index 62%
|
| copy from chromeos/network/network_configuration_handler.h
|
| copy to chromeos/network/managed_network_configuration_handler.h
|
| index c7f6a8283b5eddec1b5400152082672b0ea18d1e..9cf266ef5726297321759a09bcc0879ed51adff4 100644
|
| --- a/chromeos/network/network_configuration_handler.h
|
| +++ b/chromeos/network/managed_network_configuration_handler.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_
|
| -#define CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_
|
| +#ifndef CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_
|
| +#define CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_
|
|
|
| #include <string>
|
| #include <vector>
|
| @@ -20,16 +20,25 @@ class DictionaryValue;
|
|
|
| namespace chromeos {
|
|
|
| -// The NetworkConfigurationHandler class is used to create and configure
|
| -// networks in ChromeOS. It mostly calls through to the Shill service API, and
|
| -// most calls are asynchronous for that reason. No calls will block on DBus
|
| -// calls.
|
| +// The ManagedNetworkConfigurationHandler class is used to create and configure
|
| +// networks in ChromeOS using ONC, and to enforce and apply policy coded in the
|
| +// ONC. It sends Shill dictionaries to and calls through to the
|
| +// NetworkConfigurationHandler to do the work of configuring networks. To
|
| //
|
| -// This is owned and it's lifetime managed by aura::Shell.
|
| +// For accessing lists of remembered networks, and other state information, see
|
| +// the class NetworkStateHandler.
|
| +//
|
| +// The lifetime of ManagedNetworkConfigurationHandler is managed by by the
|
| +// Chrome startup code.
|
| //
|
| // For accessing lists of remembered networks, and other state information, see
|
| // the class NetworkStateHandler.
|
| //
|
| +// This class takes ONC GUIDs as identifiers, and uses those to look up the
|
| +// service path of the requested network to pass on to Shill. When it passes
|
| +// properties to Shill, it first applies policy to the given properties and
|
| +// passes the result.
|
| +//
|
| // Note on callbacks: Because all the functions here are meant to be
|
| // asynchronous, they all take a |callback| of some type, and an
|
| // |error_callback|. When the operation succeeds, |callback| will be called, and
|
| @@ -38,32 +47,30 @@ namespace chromeos {
|
| // that is suitable for logging. None of the error message text is meant for
|
| // user consumption.
|
|
|
| -class CHROMEOS_EXPORT NetworkConfigurationHandler {
|
| +class CHROMEOS_EXPORT ManagedNetworkConfigurationHandler {
|
| public:
|
| - ~NetworkConfigurationHandler();
|
| -
|
| - // Sets the global instance. Must be called before any calls to Get().
|
| + // Initialize the singleton.
|
| static void Initialize();
|
|
|
| - // Destroys the global instance.
|
| + // Destroy the singleton.
|
| static void Shutdown();
|
|
|
| - // Gets the global instance. Initialize() must be called first.
|
| - static NetworkConfigurationHandler* Get();
|
| + // Initialize must be called before this.
|
| + static ManagedNetworkConfigurationHandler* Get();
|
|
|
| - // Gets the properties of the network with id |service_path|. See note on
|
| + // Gets the properties of the network with id |guid|. See note on
|
| // |callback| and |error_callback|, in class description above.
|
| void GetProperties(
|
| - const std::string& service_path,
|
| + const std::string& guid,
|
| const network_handler::DictionaryResultCallback& callback,
|
| const network_handler::ErrorCallback& error_callback) const;
|
|
|
| - // Sets the properties of the network with id |service_path|. This means the
|
| + // Sets the properties of the network with id |guid|. This means the
|
| // given properties will be merged with the existing settings, and it won't
|
| // clear any existing properties. See note on |callback| and |error_callback|,
|
| // in class description above.
|
| void SetProperties(
|
| - const std::string& service_path,
|
| + const std::string& guid,
|
| const base::DictionaryValue& properties,
|
| const base::Closure& callback,
|
| const network_handler::ErrorCallback& error_callback) const;
|
| @@ -74,49 +81,48 @@ class CHROMEOS_EXPORT NetworkConfigurationHandler {
|
| // "errors" key of the error data, and the |callback| will not be run, even
|
| // though some of the properties may have been cleared. If there are no
|
| // errors, |callback| will be run.
|
| - void ClearProperties(const std::string& service_path,
|
| + void ClearProperties(const std::string& guid,
|
| const std::vector<std::string>& property_paths,
|
| const base::Closure& callback,
|
| const network_handler::ErrorCallback& error_callback);
|
|
|
| - // Initiates a connection with network that has id |service_path|. See note on
|
| + // Initiates a connection with network that has id |guid|. See note on
|
| // |callback| and |error_callback|, in class description above.
|
| - void Connect(const std::string& service_path,
|
| + void Connect(const std::string& guid,
|
| const base::Closure& callback,
|
| const network_handler::ErrorCallback& error_callback) const;
|
|
|
| - // Initiates a disconnect with the network at |service_path|. See note on
|
| + // Initiates a disconnect with the network at |guid|. See note on
|
| // |callback| and |error_callback|, in class description above.
|
| - void Disconnect(const std::string& service_path,
|
| + void Disconnect(const std::string& guid,
|
| const base::Closure& callback,
|
| const network_handler::ErrorCallback& error_callback) const;
|
|
|
|
|
| // Creates a network with the given properties in the active Shill profile,
|
| - // and returns the properties to |callback| if successful, along with the new
|
| - // service_path. See note on |callback| and |error_callback|, in class
|
| - // description above.
|
| + // and returns the new GUID to |callback| if successful. See note on
|
| + // |callback| and |error_callback|, in class description above.
|
| void CreateConfiguration(
|
| const base::DictionaryValue& properties,
|
| const network_handler::StringResultCallback& callback,
|
| const network_handler::ErrorCallback& error_callback) const;
|
|
|
| - // Removes the network |service_path| from the remembered network list in the
|
| + // Removes the network |guid| from the remembered network list in the
|
| // active Shill profile. The network may still show up in the visible networks
|
| // after this, but no profile configuration will remain. See note on
|
| // |callback| and |error_callback|, in class description above.
|
| void RemoveConfiguration(
|
| - const std::string& service_path,
|
| + const std::string& guid,
|
| const base::Closure& callback,
|
| const network_handler::ErrorCallback& error_callback) const;
|
|
|
| private:
|
| - friend class NetworkConfigurationHandlerTest;
|
| - NetworkConfigurationHandler();
|
| + ManagedNetworkConfigurationHandler();
|
| + ~ManagedNetworkConfigurationHandler();
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationHandler);
|
| + DISALLOW_COPY_AND_ASSIGN(ManagedNetworkConfigurationHandler);
|
| };
|
|
|
| } // namespace chromeos
|
|
|
| -#endif // CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_
|
| +#endif // CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_
|
|
|