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

Unified Diff: extensions/renderer/argument_spec_builder.cc

Issue 2947463002: [Extensions Bindings] Add a bindings/ subdirectory under renderer (Closed)
Patch Set: . Created 3 years, 6 months 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
« no previous file with comments | « extensions/renderer/argument_spec_builder.h ('k') | extensions/renderer/argument_spec_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/argument_spec_builder.cc
diff --git a/extensions/renderer/argument_spec_builder.cc b/extensions/renderer/argument_spec_builder.cc
deleted file mode 100644
index 1805a0b12a633c85a173b666eef6ec8bb7dc80ec..0000000000000000000000000000000000000000
--- a/extensions/renderer/argument_spec_builder.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2017 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 "extensions/renderer/argument_spec_builder.h"
-
-#include "base/memory/ptr_util.h"
-
-namespace extensions {
-
-ArgumentSpecBuilder::ArgumentSpecBuilder(ArgumentType type)
- : ArgumentSpecBuilder(type, base::StringPiece()) {}
-
-ArgumentSpecBuilder::ArgumentSpecBuilder(ArgumentType type,
- base::StringPiece name)
- : spec_(base::MakeUnique<ArgumentSpec>(type)) {
- if (!name.empty())
- spec_->set_name(name);
-}
-
-ArgumentSpecBuilder::~ArgumentSpecBuilder() {}
-
-ArgumentSpecBuilder& ArgumentSpecBuilder::MakeOptional() {
- spec_->set_optional(true);
- return *this;
-}
-
-ArgumentSpecBuilder& ArgumentSpecBuilder::AddProperty(
- base::StringPiece property_name,
- std::unique_ptr<ArgumentSpec> property_spec) {
- properties_[property_name.as_string()] = std::move(property_spec);
- return *this;
-}
-
-ArgumentSpecBuilder& ArgumentSpecBuilder::SetMinimum(int minimum) {
- spec_->set_minimum(minimum);
- return *this;
-}
-
-ArgumentSpecBuilder& ArgumentSpecBuilder::SetListType(
- std::unique_ptr<ArgumentSpec> list_type) {
- spec_->set_list_element_type(std::move(list_type));
- return *this;
-}
-
-ArgumentSpecBuilder& ArgumentSpecBuilder::SetRef(base::StringPiece ref) {
- spec_->set_ref(ref);
- return *this;
-}
-
-ArgumentSpecBuilder& ArgumentSpecBuilder::SetChoices(
- std::vector<std::unique_ptr<ArgumentSpec>> choices) {
- spec_->set_choices(std::move(choices));
- return *this;
-}
-
-ArgumentSpecBuilder& ArgumentSpecBuilder::SetEnums(
- std::set<std::string> enum_values) {
- spec_->set_enum_values(std::move(enum_values));
- return *this;
-}
-
-ArgumentSpecBuilder& ArgumentSpecBuilder::SetAdditionalProperties(
- std::unique_ptr<ArgumentSpec> additional_properties) {
- spec_->set_additional_properties(std::move(additional_properties));
- return *this;
-}
-
-std::unique_ptr<ArgumentSpec> ArgumentSpecBuilder::Build() {
- spec_->set_properties(std::move(properties_));
- return std::move(spec_);
-}
-
-} // namespace extensions
« no previous file with comments | « extensions/renderer/argument_spec_builder.h ('k') | extensions/renderer/argument_spec_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698