| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "extensions/browser/api/bluetooth_low_energy/utils.h" | 5 #include "extensions/browser/api/bluetooth_low_energy/utils.h" |
| 6 | 6 |
| 7 namespace extensions { | 7 namespace extensions { |
| 8 namespace core_api { | 8 namespace core_api { |
| 9 namespace bluetooth_low_energy { | 9 namespace bluetooth_low_energy { |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 return to.Pass(); | 36 return to.Pass(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 scoped_ptr<base::DictionaryValue> DescriptorToValue(Descriptor* from) { | 39 scoped_ptr<base::DictionaryValue> DescriptorToValue(Descriptor* from) { |
| 40 // Copy the characteristic properties and set them later manually. | 40 // Copy the characteristic properties and set them later manually. |
| 41 std::vector<CharacteristicProperty> properties = | 41 std::vector<CharacteristicProperty> properties = |
| 42 from->characteristic.properties; | 42 from->characteristic.properties; |
| 43 from->characteristic.properties.clear(); | 43 from->characteristic.properties.clear(); |
| 44 scoped_ptr<base::DictionaryValue> to = from->ToValue(); | 44 scoped_ptr<base::DictionaryValue> to = from->ToValue(); |
| 45 | 45 |
| 46 base::DictionaryValue* chrc_value = NULL; | 46 base::DictionaryValue* chrc_value = nullptr; |
| 47 to->GetDictionaryWithoutPathExpansion("characteristic", &chrc_value); | 47 to->GetDictionaryWithoutPathExpansion("characteristic", &chrc_value); |
| 48 DCHECK(chrc_value); | 48 DCHECK(chrc_value); |
| 49 chrc_value->SetWithoutPathExpansion( | 49 chrc_value->SetWithoutPathExpansion( |
| 50 "properties", CharacteristicPropertiesToValue(properties).release()); | 50 "properties", CharacteristicPropertiesToValue(properties).release()); |
| 51 return to.Pass(); | 51 return to.Pass(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace bluetooth_low_energy | 54 } // namespace bluetooth_low_energy |
| 55 } // namespace core_api | 55 } // namespace core_api |
| 56 } // namespace extensions | 56 } // namespace extensions |
| OLD | NEW |