Chromium Code Reviews| Index: generated_files_will_not_submit/experimental.declarative.cc |
| diff --git a/generated_files_will_not_submit/experimental.declarative.cc b/generated_files_will_not_submit/experimental.declarative.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b76c6b7ea2d19cc7d0bbe46e28f4b6adf87a7379 |
| --- /dev/null |
| +++ b/generated_files_will_not_submit/experimental.declarative.cc |
| @@ -0,0 +1,143 @@ |
| +// 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. |
| + |
| +// GENERATED FROM THE API DEFINITION IN |
| +// chrome/common/extensions/api/experimental.declarative.json |
| +// DO NOT EDIT. |
| + |
| +#include "tools/json_schema_compiler/util.h" |
| +#include "chrome/common/extensions/api/experimental.declarative.h" |
| + |
| +namespace extensions { |
| +namespace api { |
| +namespace experimental_declarative { |
| + |
| +// |
| +// Types |
| +// |
| + |
| +Rule::Rule() {} |
| +Rule::~Rule() {} |
| + |
| +// static |
| +bool Rule::Populate(const Value& value, Rule* out) { |
| + if (!value.IsType(Value::TYPE_DICTIONARY)) |
| + return false; |
| + const DictionaryValue* dict = static_cast<const DictionaryValue*>(&value); |
| + |
| + int priority_temp; |
| + if(dict->GetInteger("priority", &priority_temp)) |
|
not at google - send to devlin
2012/02/05 23:42:12
space between "if" and the (
The reason why I had
calamity
2012/02/06 11:51:18
Done.
|
| + out->priority.reset(new int(priority_temp)); |
| + if(!json_schema_compiler::util::GetArrayFromDictionary(*dict, "conditions", &out->conditions)) |
|
not at google - send to devlin
2012/02/05 23:42:12
ditto with the "if" (etc)
calamity
2012/02/06 11:51:18
Done.
|
| + return false; |
| + std::string id_temp; |
| + if(dict->GetString("id", &id_temp)) |
| + out->id.reset(new std::string(id_temp)); |
| + if(!json_schema_compiler::util::GetArrayFromDictionary(*dict, "actions", &out->actions)) |
| + return false; |
| + return true; |
| +} |
| + |
| +DictionaryValue* Rule::ToValue() const { |
| + DictionaryValue* value = new DictionaryValue(); |
| + |
| + if(priority.get()) |
|
not at google - send to devlin
2012/02/05 23:42:12
and here
calamity
2012/02/06 11:51:18
Done.
|
| + value->SetWithoutPathExpansion("priority", Value::CreateIntegerValue(*priority)); |
| + json_schema_compiler::util::SetArrayToDictionary(conditions, "conditions", value); |
| + if(id.get()) |
| + value->SetWithoutPathExpansion("id", Value::CreateStringValue(*id)); |
| + json_schema_compiler::util::SetArrayToDictionary(actions, "actions", value); |
| + |
| + return value; |
| +} |
| + |
| + |
| +// |
| +// Functions |
| +// |
| + |
| +GetRules::Params::Params() {} |
| +GetRules::Params::~Params() {} |
| + |
| +// static |
| +scoped_ptr<GetRules::Params> GetRules::Params::Create(const ListValue& args) { |
| + |
|
not at google - send to devlin
2012/02/05 23:42:12
extra \n
calamity
2012/02/06 11:51:18
Done.
|
| + scoped_ptr<Params> params(new Params()); |
| + |
| + if(!args.GetString(0, ¶ms->event)) |
| + return scoped_ptr<Params>(); |
| + |
| + ListValue* rule_identifiers_param = NULL; |
| + if (!args.GetList(1, &rule_identifiers_param)) |
| + return scoped_ptr<Params>(); |
| + if (!json_schema_compiler::util::GetArrayFromList(*rule_identifiers_param, ¶ms->rule_identifiers)) |
| + return scoped_ptr<Params>(); |
| + |
| + return params.Pass(); |
| +} |
| + |
| +// static |
| +// Rules that were registered, the optional parameters are filled with values. |
| +Value* GetRules::Result::Create(const std::vector<linked_ptr<Rule> > rules) { |
| + ListValue* value = new ListValue(); |
| + json_schema_compiler::util::SetArrayToList(rules, value); |
| + return value; |
| +} |
| + |
| +RemoveRules::Params::Params() {} |
| +RemoveRules::Params::~Params() {} |
| + |
| +// static |
| +scoped_ptr<RemoveRules::Params> RemoveRules::Params::Create(const ListValue& args) { |
| + |
| + scoped_ptr<Params> params(new Params()); |
| + |
| + if(!args.GetString(0, ¶ms->event)) |
| + return scoped_ptr<Params>(); |
| + |
| + ListValue* rule_identifiers_param = NULL; |
| + if (!args.GetList(1, &rule_identifiers_param)) |
| + return scoped_ptr<Params>(); |
| + if (!json_schema_compiler::util::GetArrayFromList(*rule_identifiers_param, ¶ms->rule_identifiers)) |
| + return scoped_ptr<Params>(); |
| + |
| + return params.Pass(); |
| +} |
| + |
| +// static |
| +Value* RemoveRules::Result::Create() { |
| + return Value::CreateNullValue(); |
| +} |
| + |
| +AddRules::Params::Params() {} |
| +AddRules::Params::~Params() {} |
| + |
| +// static |
| +scoped_ptr<AddRules::Params> AddRules::Params::Create(const ListValue& args) { |
| + |
| + scoped_ptr<Params> params(new Params()); |
| + |
| + if(!args.GetString(0, ¶ms->event)) |
| + return scoped_ptr<Params>(); |
| + |
| + ListValue* rules_param = NULL; |
| + if (!args.GetList(1, &rules_param)) |
| + return scoped_ptr<Params>(); |
| + if (!json_schema_compiler::util::GetArrayFromList(*rules_param, ¶ms->rules)) |
| + return scoped_ptr<Params>(); |
| + |
| + return params.Pass(); |
| +} |
| + |
| +// static |
| +// Rules that were registered, the optional parameters are filled with values. |
| +Value* AddRules::Result::Create(const std::vector<linked_ptr<Rule> > rules) { |
| + ListValue* value = new ListValue(); |
| + json_schema_compiler::util::SetArrayToList(rules, value); |
| + return value; |
| +} |
| + |
| +} // experimental_declarative |
| +} // api |
| +} // extensions |