summaryrefslogtreecommitdiffstats
path: root/components/wifi/wifi_service_mac.mm
diff options
context:
space:
mode:
authortbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 22:04:26 +0000
committertbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 22:04:26 +0000
commitef1136572d460356ce88c0976b6104db700dc9d7 (patch)
treea355bc8e512a3bf90985788d41313f0d2f00f454 /components/wifi/wifi_service_mac.mm
parentfac1fc07bbcdfc7c287850d37b0337ed01adb439 (diff)
downloadchromium_src-ef1136572d460356ce88c0976b6104db700dc9d7.zip
chromium_src-ef1136572d460356ce88c0976b6104db700dc9d7.tar.gz
chromium_src-ef1136572d460356ce88c0976b6104db700dc9d7.tar.bz2
Don't clear existing properties in SetProperties in WiFiService
If a property has previously been set for a network, and it's not set in new properties, networkingPrivate.setProperties should not clear it. Instead of new properties replacing existing ones, merge new properties into existing ones. (This matches ChromeOS behaviour). BUG=None TEST=None Review URL: https://codereview.chromium.org/241983002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264865 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/wifi/wifi_service_mac.mm')
-rw-r--r--components/wifi/wifi_service_mac.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/components/wifi/wifi_service_mac.mm b/components/wifi/wifi_service_mac.mm
index fabc974..eb83e17 100644
--- a/components/wifi/wifi_service_mac.mm
+++ b/components/wifi/wifi_service_mac.mm
@@ -242,8 +242,16 @@ void WiFiServiceMac::SetProperties(
const std::string& network_guid,
scoped_ptr<base::DictionaryValue> properties,
std::string* error) {
- network_properties_.SetWithoutPathExpansion(network_guid,
- properties.release());
+ base::DictionaryValue* existing_properties;
+ // If the network properties already exist, don't override previously set
+ // properties, unless they are set in |properties|.
+ if (network_properties_.GetDictionaryWithoutPathExpansion(
+ network_guid, &existing_properties)) {
+ existing_properties->MergeDictionary(properties.get());
+ } else {
+ network_properties_.SetWithoutPathExpansion(network_guid,
+ properties.release());
+ }
}
void WiFiServiceMac::CreateNetwork(