| Index: chromeos/network/network_state.h
|
| diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h
|
| index 276c368d4aa83ac9ba1d155ede09f7282317c1d3..7c8150145c941d3b6c91e9e99151e1be5bc306fb 100644
|
| --- a/chromeos/network/network_state.h
|
| +++ b/chromeos/network/network_state.h
|
| @@ -8,6 +8,7 @@
|
| #include <string>
|
| #include <vector>
|
|
|
| +#include "base/values.h"
|
| #include "chromeos/network/managed_state.h"
|
| #include "chromeos/network/network_ui_data.h"
|
| #include "components/onc/onc_constants.h"
|
| @@ -25,6 +26,11 @@ namespace chromeos {
|
| // on to. Store network_state->path() (defined in ManagedState) instead and
|
| // call NetworkStateHandler::GetNetworkState(path) to retrieve the state for
|
| // the network.
|
| +//
|
| +// Note: NetworkStateHandler will store an entry for each member of
|
| +// Manager.ServiceCompleteList. The visible() method indicates whether the
|
| +// network is visible, and the IsInProfile() method indicates whether the
|
| +// network is saved in a profile.
|
| class CHROMEOS_EXPORT NetworkState : public ManagedState {
|
| public:
|
| explicit NetworkState(const std::string& path);
|
| @@ -45,16 +51,20 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
|
| bool RequiresActivation() const;
|
|
|
| // Accessors
|
| + bool visible() const { return visible_; }
|
| const std::string& security() const { return security_; }
|
| const std::string& device_path() const { return device_path_; }
|
| const std::string& guid() const { return guid_; }
|
| - const std::string& connection_state() const { return connection_state_; }
|
| const std::string& profile_path() const { return profile_path_; }
|
| const std::string& error() const { return error_; }
|
| const std::string& last_error() const { return last_error_; }
|
| void clear_last_error() { last_error_.clear(); }
|
|
|
| + // Returns |connection_state_| if visible, kStateDisconnect otherwise.
|
| + std::string connection_state() const;
|
| +
|
| const NetworkUIData& ui_data() const { return ui_data_; }
|
| + const base::DictionaryValue& proxy_config() const { return proxy_config_; }
|
|
|
| // IPConfig Properties. These require an extra call to ShillIPConfigClient,
|
| // so cache them to avoid excessively complex client code.
|
| @@ -90,6 +100,9 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
|
| bool IsConnectedState() const;
|
| bool IsConnectingState() const;
|
|
|
| + // Returns true if this is a network stored in a profile.
|
| + bool IsInProfile() const;
|
| +
|
| // Returns true if the network properties are stored in a user profile.
|
| bool IsPrivate() const;
|
|
|
| @@ -99,6 +112,11 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
|
| // Converts the prefix length to a netmask string.
|
| std::string GetNetmask() const;
|
|
|
| + // Returns a specifier for identifying this network in the absence of a GUID.
|
| + // This should only be used by NetworkStateHandler for keeping track of
|
| + // GUIDs assigned to unsaved networks.
|
| + std::string GetSpecifier() const;
|
| +
|
| // Set the GUID. Called exclusively by NetworkStateHandler.
|
| void SetGuid(const std::string& guid);
|
|
|
| @@ -116,6 +134,11 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
|
| // Returns true if |name_| changes.
|
| bool UpdateName(const base::DictionaryValue& properties);
|
|
|
| + void set_visible(bool visible) { visible_ = visible; }
|
| +
|
| + // Set to true if the network is a member of Manager.Services.
|
| + bool visible_;
|
| +
|
| // Network Service properties. Avoid adding any additional properties here.
|
| // Instead use NetworkConfigurationHandler::GetProperties() to asynchronously
|
| // request properties from Shill.
|
| @@ -162,6 +185,10 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState {
|
| // for migration to PEM.
|
| bool has_ca_cert_nss_;
|
|
|
| + // TODO(pneubeck): Remove this once (Managed)NetworkConfigurationHandler
|
| + // provides proxy configuration. crbug.com/241775
|
| + base::DictionaryValue proxy_config_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(NetworkState);
|
| };
|
|
|
|
|