| 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 #include "extensions/common/value_builder.h" | 5 #include "extensions/common/value_builder.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 DictionaryBuilder& DictionaryBuilder::Set(const std::string& path, | 37 DictionaryBuilder& DictionaryBuilder::Set(const std::string& path, |
| 38 double in_value) { | 38 double in_value) { |
| 39 dict_->SetWithoutPathExpansion(path, base::MakeUnique<base::Value>(in_value)); | 39 dict_->SetWithoutPathExpansion(path, base::MakeUnique<base::Value>(in_value)); |
| 40 return *this; | 40 return *this; |
| 41 } | 41 } |
| 42 | 42 |
| 43 DictionaryBuilder& DictionaryBuilder::Set(const std::string& path, | 43 DictionaryBuilder& DictionaryBuilder::Set(const std::string& path, |
| 44 const std::string& in_value) { | 44 const std::string& in_value) { |
| 45 dict_->SetWithoutPathExpansion(path, | 45 dict_->SetWithoutPathExpansion(path, base::MakeUnique<base::Value>(in_value)); |
| 46 base::MakeUnique<base::StringValue>(in_value)); | |
| 47 return *this; | 46 return *this; |
| 48 } | 47 } |
| 49 | 48 |
| 50 DictionaryBuilder& DictionaryBuilder::Set(const std::string& path, | 49 DictionaryBuilder& DictionaryBuilder::Set(const std::string& path, |
| 51 const base::string16& in_value) { | 50 const base::string16& in_value) { |
| 52 dict_->SetWithoutPathExpansion(path, | 51 dict_->SetWithoutPathExpansion(path, base::MakeUnique<base::Value>(in_value)); |
| 53 base::MakeUnique<base::StringValue>(in_value)); | |
| 54 return *this; | 52 return *this; |
| 55 } | 53 } |
| 56 | 54 |
| 57 DictionaryBuilder& DictionaryBuilder::Set( | 55 DictionaryBuilder& DictionaryBuilder::Set( |
| 58 const std::string& path, | 56 const std::string& path, |
| 59 std::unique_ptr<base::Value> in_value) { | 57 std::unique_ptr<base::Value> in_value) { |
| 60 dict_->SetWithoutPathExpansion(path, std::move(in_value)); | 58 dict_->SetWithoutPathExpansion(path, std::move(in_value)); |
| 61 return *this; | 59 return *this; |
| 62 } | 60 } |
| 63 | 61 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 list_->Append(std::move(in_value)); | 96 list_->Append(std::move(in_value)); |
| 99 return *this; | 97 return *this; |
| 100 } | 98 } |
| 101 | 99 |
| 102 ListBuilder& ListBuilder::AppendBoolean(bool in_value) { | 100 ListBuilder& ListBuilder::AppendBoolean(bool in_value) { |
| 103 list_->AppendBoolean(in_value); | 101 list_->AppendBoolean(in_value); |
| 104 return *this; | 102 return *this; |
| 105 } | 103 } |
| 106 | 104 |
| 107 } // namespace extensions | 105 } // namespace extensions |
| OLD | NEW |