summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/network/managed_network_configuration_handler.h5
-rw-r--r--chromeos/network/managed_network_configuration_handler_impl.cc9
-rw-r--r--chromeos/network/managed_network_configuration_handler_impl.h3
-rw-r--r--chromeos/network/mock_managed_network_configuration_handler.h2
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,