Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5542)

Unified Diff: chrome/common/extensions/value_builder.cc

Issue 48643003: Moved extension and value builder code to extensions component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/value_builder.cc
diff --git a/chrome/common/extensions/value_builder.cc b/chrome/common/extensions/value_builder.cc
deleted file mode 100644
index 1fd67943e8f4b86939da02f7aebdbda0ed99535b..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/value_builder.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/extensions/value_builder.h"
-
-namespace extensions {
-
-// DictionaryBuilder
-
-DictionaryBuilder::DictionaryBuilder() : dict_(new base::DictionaryValue) {}
-
-DictionaryBuilder::DictionaryBuilder(const base::DictionaryValue& init)
- : dict_(init.DeepCopy()) {}
-
-DictionaryBuilder::~DictionaryBuilder() {}
-
-DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
- int in_value) {
- dict_->SetWithoutPathExpansion(path, new base::FundamentalValue(in_value));
- return *this;
-}
-
-DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
- double in_value) {
- dict_->SetWithoutPathExpansion(path, new base::FundamentalValue(in_value));
- return *this;
-}
-
-DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
- const std::string& in_value) {
- dict_->SetWithoutPathExpansion(path, new base::StringValue(in_value));
- return *this;
-}
-
-DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
- const string16& in_value) {
- dict_->SetWithoutPathExpansion(path, new base::StringValue(in_value));
- return *this;
-}
-
-DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
- DictionaryBuilder& in_value) {
- dict_->SetWithoutPathExpansion(path, in_value.Build().release());
- return *this;
-}
-
-DictionaryBuilder& DictionaryBuilder::Set(const std::string& path,
- ListBuilder& in_value) {
- dict_->SetWithoutPathExpansion(path, in_value.Build().release());
- return *this;
-}
-
-DictionaryBuilder& DictionaryBuilder::SetBoolean(
- const std::string& path, bool in_value) {
- dict_->SetWithoutPathExpansion(path, new base::FundamentalValue(in_value));
- return *this;
-}
-
-// ListBuilder
-
-ListBuilder::ListBuilder() : list_(new base::ListValue) {}
-ListBuilder::ListBuilder(const base::ListValue& init) : list_(init.DeepCopy()) {
-}
-ListBuilder::~ListBuilder() {}
-
-ListBuilder& ListBuilder::Append(int in_value) {
- list_->Append(new base::FundamentalValue(in_value));
- return *this;
-}
-
-ListBuilder& ListBuilder::Append(double in_value) {
- list_->Append(new base::FundamentalValue(in_value));
- return *this;
-}
-
-ListBuilder& ListBuilder::Append(const std::string& in_value) {
- list_->Append(new base::StringValue(in_value));
- return *this;
-}
-
-ListBuilder& ListBuilder::Append(const string16& in_value) {
- list_->Append(new base::StringValue(in_value));
- return *this;
-}
-
-ListBuilder& ListBuilder::Append(DictionaryBuilder& in_value) {
- list_->Append(in_value.Build().release());
- return *this;
-}
-
-ListBuilder& ListBuilder::Append(ListBuilder& in_value) {
- list_->Append(in_value.Build().release());
- return *this;
-}
-
-ListBuilder& ListBuilder::AppendBoolean(bool in_value) {
- list_->Append(new base::FundamentalValue(in_value));
- return *this;
-}
-
-} // namespace extensions
« no previous file with comments | « chrome/common/extensions/value_builder.h ('k') | chrome/renderer/chrome_content_renderer_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698