| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_IMPL_H_ | 5 #ifndef CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_IMPL_H_ |
| 6 #define CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_IMPL_H_ | 6 #define CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 public: | 36 public: |
| 37 virtual ~ManagedNetworkConfigurationHandlerImpl(); | 37 virtual ~ManagedNetworkConfigurationHandlerImpl(); |
| 38 | 38 |
| 39 // ManagedNetworkConfigurationHandler overrides | 39 // ManagedNetworkConfigurationHandler overrides |
| 40 virtual void AddObserver(NetworkPolicyObserver* observer) OVERRIDE; | 40 virtual void AddObserver(NetworkPolicyObserver* observer) OVERRIDE; |
| 41 virtual void RemoveObserver(NetworkPolicyObserver* observer) OVERRIDE; | 41 virtual void RemoveObserver(NetworkPolicyObserver* observer) OVERRIDE; |
| 42 | 42 |
| 43 virtual void GetProperties( | 43 virtual void GetProperties( |
| 44 const std::string& service_path, | 44 const std::string& service_path, |
| 45 const network_handler::DictionaryResultCallback& callback, | 45 const network_handler::DictionaryResultCallback& callback, |
| 46 const network_handler::ErrorCallback& error_callback) const OVERRIDE; | 46 const network_handler::ErrorCallback& error_callback) OVERRIDE; |
| 47 | 47 |
| 48 virtual void GetManagedProperties( | 48 virtual void GetManagedProperties( |
| 49 const std::string& userhash, | 49 const std::string& userhash, |
| 50 const std::string& service_path, | 50 const std::string& service_path, |
| 51 const network_handler::DictionaryResultCallback& callback, | 51 const network_handler::DictionaryResultCallback& callback, |
| 52 const network_handler::ErrorCallback& error_callback) OVERRIDE; | 52 const network_handler::ErrorCallback& error_callback) OVERRIDE; |
| 53 | 53 |
| 54 virtual void SetProperties( | 54 virtual void SetProperties( |
| 55 const std::string& service_path, | 55 const std::string& service_path, |
| 56 const base::DictionaryValue& user_settings, | 56 const base::DictionaryValue& user_settings, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void Init(NetworkStateHandler* network_state_handler, | 113 void Init(NetworkStateHandler* network_state_handler, |
| 114 NetworkProfileHandler* network_profile_handler, | 114 NetworkProfileHandler* network_profile_handler, |
| 115 NetworkConfigurationHandler* network_configuration_handler); | 115 NetworkConfigurationHandler* network_configuration_handler); |
| 116 | 116 |
| 117 void GetManagedPropertiesCallback( | 117 void GetManagedPropertiesCallback( |
| 118 const network_handler::DictionaryResultCallback& callback, | 118 const network_handler::DictionaryResultCallback& callback, |
| 119 const network_handler::ErrorCallback& error_callback, | 119 const network_handler::ErrorCallback& error_callback, |
| 120 const std::string& service_path, | 120 const std::string& service_path, |
| 121 const base::DictionaryValue& shill_properties); | 121 const base::DictionaryValue& shill_properties); |
| 122 | 122 |
| 123 void GetPropertiesCallback( |
| 124 const network_handler::DictionaryResultCallback& callback, |
| 125 const std::string& service_path, |
| 126 const base::DictionaryValue& shill_properties); |
| 127 |
| 123 const Policies* GetPoliciesForUser(const std::string& userhash) const; | 128 const Policies* GetPoliciesForUser(const std::string& userhash) const; |
| 124 const Policies* GetPoliciesForProfile(const NetworkProfile& profile) const; | 129 const Policies* GetPoliciesForProfile(const NetworkProfile& profile) const; |
| 125 | 130 |
| 126 void OnPolicyAppliedToNetwork(const std::string& service_path); | 131 void OnPolicyAppliedToNetwork(const std::string& service_path); |
| 127 | 132 |
| 133 // Helper method to append "IPConfigs" property to |properties| by extracting |
| 134 // them from the associated DeviceState. |
| 135 void GetIPConfigs(const std::string& service_path, |
| 136 base::DictionaryValue* properties); |
| 137 |
| 128 // If present, the empty string maps to the device policy. | 138 // If present, the empty string maps to the device policy. |
| 129 UserToPoliciesMap policies_by_user_; | 139 UserToPoliciesMap policies_by_user_; |
| 130 | 140 |
| 131 // Local references to the associated handler instances. | 141 // Local references to the associated handler instances. |
| 132 NetworkStateHandler* network_state_handler_; | 142 NetworkStateHandler* network_state_handler_; |
| 133 NetworkProfileHandler* network_profile_handler_; | 143 NetworkProfileHandler* network_profile_handler_; |
| 134 NetworkConfigurationHandler* network_configuration_handler_; | 144 NetworkConfigurationHandler* network_configuration_handler_; |
| 135 | 145 |
| 136 ObserverList<NetworkPolicyObserver> observers_; | 146 ObserverList<NetworkPolicyObserver> observers_; |
| 137 | 147 |
| 138 // For Shill client callbacks | 148 // For Shill client callbacks |
| 139 base::WeakPtrFactory<ManagedNetworkConfigurationHandlerImpl> | 149 base::WeakPtrFactory<ManagedNetworkConfigurationHandlerImpl> |
| 140 weak_ptr_factory_; | 150 weak_ptr_factory_; |
| 141 | 151 |
| 142 DISALLOW_COPY_AND_ASSIGN(ManagedNetworkConfigurationHandlerImpl); | 152 DISALLOW_COPY_AND_ASSIGN(ManagedNetworkConfigurationHandlerImpl); |
| 143 }; | 153 }; |
| 144 | 154 |
| 145 } // namespace chromeos | 155 } // namespace chromeos |
| 146 | 156 |
| 147 #endif // CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_IMPL_H_ | 157 #endif // CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_IMPL_H_ |
| OLD | NEW |