| Index: generated_files_will_not_submit/permissions.cc
|
| diff --git a/generated_files_will_not_submit/permissions.cc b/generated_files_will_not_submit/permissions.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ce9b8e50ee0b0d04acc82cd875e647e594f691e7
|
| --- /dev/null
|
| +++ b/generated_files_will_not_submit/permissions.cc
|
| @@ -0,0 +1,132 @@
|
| +// 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/permissions.json
|
| +// DO NOT EDIT.
|
| +
|
| +#include "tools/json_schema_compiler/util.h"
|
| +#include "chrome/common/extensions/api/permissions.h"
|
| +
|
| +namespace extensions {
|
| +namespace api {
|
| +namespace permissions {
|
| +
|
| +//
|
| +// Types
|
| +//
|
| +
|
| +Permissions::Permissions() {}
|
| +Permissions::~Permissions() {}
|
| +
|
| +// static
|
| +bool Permissions::Populate(const Value& value, Permissions* out) {
|
| + if (!value.IsType(Value::TYPE_DICTIONARY))
|
| + return false;
|
| + const DictionaryValue* dict = static_cast<const DictionaryValue*>(&value);
|
| +
|
| + if (!json_schema_compiler::util::GetOptionalArrayFromDictionary(*dict, "origins", &out->origins))
|
| + return false;
|
| + if (!json_schema_compiler::util::GetOptionalArrayFromDictionary(*dict, "permissions", &out->permissions))
|
| + return false;
|
| + return true;
|
| +}
|
| +
|
| +DictionaryValue* Permissions::ToValue() const {
|
| + DictionaryValue* value = new DictionaryValue();
|
| +
|
| + if (origins.get())
|
| + json_schema_compiler::util::SetOptionalArrayToDictionary(origins, "origins", value);
|
| + if (permissions.get())
|
| + json_schema_compiler::util::SetOptionalArrayToDictionary(permissions, "permissions", value);
|
| +
|
| + return value;
|
| +}
|
| +
|
| +
|
| +//
|
| +// Functions
|
| +//
|
| +
|
| +Contains::Params::Params() {}
|
| +Contains::Params::~Params() {}
|
| +
|
| +// static
|
| +scoped_ptr<Contains::Params> Contains::Params::Create(const ListValue& args) {
|
| + if (args.GetSize() < 1)
|
| + return scoped_ptr<Params>();
|
| + scoped_ptr<Params> params(new Params());
|
| +
|
| + DictionaryValue* permissions_param = NULL;
|
| + if (!args.GetDictionary(0, &permissions_param))
|
| + return scoped_ptr<Params>();
|
| + if (!Permissions::Populate(*permissions_param, ¶ms->permissions))
|
| + return scoped_ptr<Params>();
|
| +
|
| + return params.Pass();
|
| +}
|
| +
|
| +// static
|
| +// True if the extension has the specified permissions.
|
| +Value* Contains::Result::Create(const bool result) {
|
| + return Value::CreateBooleanValue(result);
|
| +}
|
| +
|
| +// static
|
| +// The extension's active permissions.
|
| +Value* GetAll::Result::Create(const Permissions& permissions) {
|
| + return permissions.ToValue();
|
| +}
|
| +
|
| +Request::Params::Params() {}
|
| +Request::Params::~Params() {}
|
| +
|
| +// static
|
| +scoped_ptr<Request::Params> Request::Params::Create(const ListValue& args) {
|
| + if (args.GetSize() < 1)
|
| + return scoped_ptr<Params>();
|
| + scoped_ptr<Params> params(new Params());
|
| +
|
| + DictionaryValue* permissions_param = NULL;
|
| + if (!args.GetDictionary(0, &permissions_param))
|
| + return scoped_ptr<Params>();
|
| + if (!Permissions::Populate(*permissions_param, ¶ms->permissions))
|
| + return scoped_ptr<Params>();
|
| +
|
| + return params.Pass();
|
| +}
|
| +
|
| +// static
|
| +// True if the user granted the specified permissions.
|
| +Value* Request::Result::Create(const bool granted) {
|
| + return Value::CreateBooleanValue(granted);
|
| +}
|
| +
|
| +Remove::Params::Params() {}
|
| +Remove::Params::~Params() {}
|
| +
|
| +// static
|
| +scoped_ptr<Remove::Params> Remove::Params::Create(const ListValue& args) {
|
| + if (args.GetSize() < 1)
|
| + return scoped_ptr<Params>();
|
| + scoped_ptr<Params> params(new Params());
|
| +
|
| + DictionaryValue* permissions_param = NULL;
|
| + if (!args.GetDictionary(0, &permissions_param))
|
| + return scoped_ptr<Params>();
|
| + if (!Permissions::Populate(*permissions_param, ¶ms->permissions))
|
| + return scoped_ptr<Params>();
|
| +
|
| + return params.Pass();
|
| +}
|
| +
|
| +// static
|
| +// True if the permissions were removed.
|
| +Value* Remove::Result::Create(const bool removed) {
|
| + return Value::CreateBooleanValue(removed);
|
| +}
|
| +
|
| +} // permissions
|
| +} // api
|
| +} // extensions
|
|
|