diff options
author | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-22 01:43:11 +0000 |
---|---|---|
committer | pneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-22 01:43:11 +0000 |
commit | 8ffd206ba2dc08c17578afeac15a17be8b21b099 (patch) | |
tree | 6b41b8905798a5820fd505e60572844498ca4bb3 /chromeos | |
parent | bdca4f48d8f7bd4a1644bb496ca373c4eb6fcbba (diff) | |
download | chromium_src-8ffd206ba2dc08c17578afeac15a17be8b21b099.zip chromium_src-8ffd206ba2dc08c17578afeac15a17be8b21b099.tar.gz chromium_src-8ffd206ba2dc08c17578afeac15a17be8b21b099.tar.bz2 |
Enforce autoconnect policy in the network dialogs.
This disables autoconnect in the dialog for configuring new or existing networks in CrOS if the new Autoconnect policy is set.
Depends on: https://codereview.chromium.org/23526016/
BUG=280146
Review URL: https://codereview.chromium.org/27273006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229998 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
4 files changed, 19 insertions, 0 deletions
diff --git a/chromeos/network/managed_network_configuration_handler.h b/chromeos/network/managed_network_configuration_handler.h index ea7a446..bc58492 100644 --- a/chromeos/network/managed_network_configuration_handler.h +++ b/chromeos/network/managed_network_configuration_handler.h @@ -121,6 +121,11 @@ class CHROMEOS_EXPORT ManagedNetworkConfigurationHandler { const std::string& guid, ::onc::ONCSource* onc_source) const = 0; + // Returns the global configuration of the policy of user |userhash| or device + // policy if |userhash| is empty. + virtual const base::DictionaryValue* GetGlobalConfigFromPolicy( + const std::string userhash) const = 0; + // Returns the policy with |guid| for profile |profile_path|. If such // doesn't exist, returns NULL. virtual const base::DictionaryValue* FindPolicyByGuidAndProfile( diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc index c3c3242..73e5e07 100644 --- a/chromeos/network/managed_network_configuration_handler_impl.cc +++ b/chromeos/network/managed_network_configuration_handler_impl.cc @@ -552,6 +552,15 @@ ManagedNetworkConfigurationHandlerImpl::FindPolicyByGUID( } const base::DictionaryValue* +ManagedNetworkConfigurationHandlerImpl::GetGlobalConfigFromPolicy( + const std::string userhash) const { + const Policies* policies = GetPoliciesForUser(userhash); + if (!policies) + return NULL; + + return &policies->global_network_config; +} +const base::DictionaryValue* ManagedNetworkConfigurationHandlerImpl::FindPolicyByGuidAndProfile( const std::string& guid, const std::string& profile_path) const { diff --git a/chromeos/network/managed_network_configuration_handler_impl.h b/chromeos/network/managed_network_configuration_handler_impl.h index 95593b3..19b8eb8 100644 --- a/chromeos/network/managed_network_configuration_handler_impl.h +++ b/chromeos/network/managed_network_configuration_handler_impl.h @@ -79,6 +79,9 @@ class CHROMEOS_EXPORT ManagedNetworkConfigurationHandlerImpl const std::string& guid, onc::ONCSource* onc_source) const OVERRIDE; + virtual const base::DictionaryValue* GetGlobalConfigFromPolicy( + const std::string userhash) const OVERRIDE; + virtual const base::DictionaryValue* FindPolicyByGuidAndProfile( const std::string& guid, const std::string& profile_path) const OVERRIDE; diff --git a/chromeos/network/mock_managed_network_configuration_handler.h b/chromeos/network/mock_managed_network_configuration_handler.h index e73e598..4bde68d 100644 --- a/chromeos/network/mock_managed_network_configuration_handler.h +++ b/chromeos/network/mock_managed_network_configuration_handler.h @@ -59,6 +59,8 @@ class CHROMEOS_EXPORT MockManagedNetworkConfigurationHandler const std::string userhash, const std::string& guid, ::onc::ONCSource* onc_source)); + MOCK_CONST_METHOD1(GetGlobalConfigFromPolicy, + const base::DictionaryValue*(const std::string userhash)); MOCK_CONST_METHOD2( FindPolicyByGuidAndProfile, const base::DictionaryValue*(const std::string& guid, |