| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chromecast/base/device_capabilities_impl.h" | 5 #include "chromecast/base/device_capabilities_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 // static | 56 // static |
| 57 std::unique_ptr<DeviceCapabilities> DeviceCapabilities::Create() { | 57 std::unique_ptr<DeviceCapabilities> DeviceCapabilities::Create() { |
| 58 return base::WrapUnique(new DeviceCapabilitiesImpl); | 58 return base::WrapUnique(new DeviceCapabilitiesImpl); |
| 59 } | 59 } |
| 60 | 60 |
| 61 // static | 61 // static |
| 62 std::unique_ptr<DeviceCapabilities> DeviceCapabilities::CreateForTesting() { | 62 std::unique_ptr<DeviceCapabilities> DeviceCapabilities::CreateForTesting() { |
| 63 DeviceCapabilities* capabilities = new DeviceCapabilitiesImpl; | 63 DeviceCapabilities* capabilities = new DeviceCapabilitiesImpl; |
| 64 capabilities->SetCapability(kKeyBluetoothSupported, | 64 capabilities->SetCapability(kKeyBluetoothSupported, |
| 65 base::MakeUnique<base::FundamentalValue>(false)); | 65 base::MakeUnique<base::Value>(false)); |
| 66 capabilities->SetCapability(kKeyDisplaySupported, | 66 capabilities->SetCapability(kKeyDisplaySupported, |
| 67 base::MakeUnique<base::FundamentalValue>(true)); | 67 base::MakeUnique<base::Value>(true)); |
| 68 capabilities->SetCapability(kKeyHiResAudioSupported, | 68 capabilities->SetCapability(kKeyHiResAudioSupported, |
| 69 base::MakeUnique<base::FundamentalValue>(false)); | 69 base::MakeUnique<base::Value>(false)); |
| 70 capabilities->SetCapability(kKeyAssistantSupported, | 70 capabilities->SetCapability(kKeyAssistantSupported, |
| 71 base::MakeUnique<base::FundamentalValue>(true)); | 71 base::MakeUnique<base::Value>(true)); |
| 72 return base::WrapUnique(capabilities); | 72 return base::WrapUnique(capabilities); |
| 73 } | 73 } |
| 74 | 74 |
| 75 scoped_refptr<DeviceCapabilities::Data> DeviceCapabilities::CreateData() { | 75 scoped_refptr<DeviceCapabilities::Data> DeviceCapabilities::CreateData() { |
| 76 return make_scoped_refptr(new Data); | 76 return make_scoped_refptr(new Data); |
| 77 } | 77 } |
| 78 | 78 |
| 79 scoped_refptr<DeviceCapabilities::Data> DeviceCapabilities::CreateData( | 79 scoped_refptr<DeviceCapabilities::Data> DeviceCapabilities::CreateData( |
| 80 std::unique_ptr<const base::DictionaryValue> dictionary) { | 80 std::unique_ptr<const base::DictionaryValue> dictionary) { |
| 81 DCHECK(dictionary.get()); | 81 DCHECK(dictionary.get()); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 DeviceCapabilitiesImpl::GenerateDataWithNewValue( | 424 DeviceCapabilitiesImpl::GenerateDataWithNewValue( |
| 425 const base::DictionaryValue& dict, | 425 const base::DictionaryValue& dict, |
| 426 const std::string& path, | 426 const std::string& path, |
| 427 std::unique_ptr<base::Value> new_value) { | 427 std::unique_ptr<base::Value> new_value) { |
| 428 std::unique_ptr<base::DictionaryValue> dict_deep_copy(dict.CreateDeepCopy()); | 428 std::unique_ptr<base::DictionaryValue> dict_deep_copy(dict.CreateDeepCopy()); |
| 429 dict_deep_copy->Set(path, std::move(new_value)); | 429 dict_deep_copy->Set(path, std::move(new_value)); |
| 430 return CreateData(std::move(dict_deep_copy)); | 430 return CreateData(std::move(dict_deep_copy)); |
| 431 } | 431 } |
| 432 | 432 |
| 433 } // namespace chromecast | 433 } // namespace chromecast |
| OLD | NEW |