Chromium Code Reviews| Index: generated_files_will_not_submit/experimental.declarative.h |
| diff --git a/generated_files_will_not_submit/experimental.declarative.h b/generated_files_will_not_submit/experimental.declarative.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d5833c3100c7bd7d960b5aabeb9af7b839043b24 |
| --- /dev/null |
| +++ b/generated_files_will_not_submit/experimental.declarative.h |
| @@ -0,0 +1,172 @@ |
| +// 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. |
| + |
| +#ifndef CHROME_COMMON_EXTENSIONS_API_EXPERIMENTAL_DECLARATIVE_H__ |
| +#define CHROME_COMMON_EXTENSIONS_API_EXPERIMENTAL_DECLARATIVE_H__ |
|
battre
2012/02/08 09:15:20
Should this go to chrome/common?
calamity
2012/02/09 00:56:52
Sorry, I'm not sure what you mean? The file is gen
battre
2012/02/09 09:00:47
I was wondering whether chrome/browser/extensions/
|
| +#pragma once |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/linked_ptr.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/values.h" |
| + |
| +using base::Value; |
|
battre
2012/02/08 09:15:20
I think the style guide prohibits "bleeding using
calamity
2012/02/09 00:56:52
Moved to the .cc file.
|
| +using base::DictionaryValue; |
| +using base::ListValue; |
| + |
| +namespace extensions { |
| +namespace api { |
| +namespace experimental_declarative { |
| + |
| +// |
| +// Types |
| +// |
| + |
| +// Description of a declarative rule for handling events. |
| +struct Rule { |
| + ~Rule(); |
| + Rule(); |
| + |
| + // Optional priority of this rule. Defaults to 100. |
| + scoped_ptr<int> priority; |
| + |
| + // List of conditions that can trigger the actions. |
| + std::vector<linked_ptr<DictionaryValue> > conditions; |
| + |
| + // Optional identifier that allows referencing this rule. |
| + scoped_ptr<std::string> id; |
| + |
| + // List of actions that are triggered if one of the condtions is fulfilled. |
| + std::vector<linked_ptr<DictionaryValue> > actions; |
| + |
| + // Populates a Rule object from a Value. Returns whether |out| was |
| + // successfully populated. |
| + static bool Populate(const Value& value, Rule* out); |
| + |
| + // Returns a new DictionaryValue representing the serialized form of this |
| + // Rule object. Passesownership to caller. |
|
battre
2012/02/08 09:15:20
nit: space after "Passes"
calamity
2012/02/09 00:56:52
Done.
|
| + DictionaryValue* ToValue() const; |
|
battre
2012/02/08 09:15:20
should this return a scoped_ptr?
calamity
2012/02/09 00:56:52
Done.
|
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(Rule); |
| +}; |
| + |
| +// |
| +// Functions |
| +// |
| + |
| +namespace GetRules { |
| + struct Params { |
| + // Name of the event this function affects. |
| + // If non-empty, only rules with identifiers contained in this array are |
| + // returned. |
| + // Name of the event this function affects. |
|
battre
2012/02/08 09:15:20
Why is the "Name of the event this function affect
calamity
2012/02/09 00:56:52
Done.
|
| + std::string event; |
| + |
| + // If non-empty, only rules with identifiers contained in this array are |
| + // returned. |
| + std::vector<std::string> rule_identifiers; |
| + |
| + ~Params(); |
| + |
| + static scoped_ptr<Params> Create(const ListValue& args); |
| + |
| + private: |
| + Params(); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(Params); |
| + }; |
| + |
| + class Result { |
| + public: |
| + // Rules that were registered, the optional parameters are filled with |
| + // values. |
| + static Value* Create(const std::vector<linked_ptr<Rule> > rules); |
| + |
| + private: |
| + Result() {}; |
| + DISALLOW_COPY_AND_ASSIGN(Result); |
| + }; |
| + |
| +}; |
| + |
| +namespace RemoveRules { |
| + struct Params { |
| + // Name of the event this function affects. |
| + // If non-empty, only rules with identifiers contained in this array are |
| + // unregistered. |
| + // Name of the event this function affects. |
| + std::string event; |
| + |
| + // If non-empty, only rules with identifiers contained in this array are |
| + // unregistered. |
| + std::vector<std::string> rule_identifiers; |
| + |
| + ~Params(); |
| + |
| + static scoped_ptr<Params> Create(const ListValue& args); |
| + |
| + private: |
| + Params(); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(Params); |
| + }; |
| + |
| + class Result { |
| + public: |
| + static Value* Create(); |
| + |
| + private: |
| + Result() {}; |
| + DISALLOW_COPY_AND_ASSIGN(Result); |
| + }; |
| + |
| +}; |
| + |
| +namespace AddRules { |
| + struct Params { |
| + // Name of the event this function affects. |
| + // Rules to be registered. These do not replace previously registered rules. |
| + // Name of the event this function affects. |
| + std::string event; |
| + |
| + // Rules to be registered. These do not replace previously registered rules. |
| + std::vector<linked_ptr<Rule> > rules; |
| + |
| + ~Params(); |
| + |
| + static scoped_ptr<Params> Create(const ListValue& args); |
| + |
| + private: |
| + Params(); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(Params); |
| + }; |
| + |
| + class Result { |
| + public: |
| + // Rules that were registered, the optional parameters are filled with |
| + // values. |
| + static Value* Create(const std::vector<linked_ptr<Rule> > rules); |
| + |
| + private: |
| + Result() {}; |
| + DISALLOW_COPY_AND_ASSIGN(Result); |
| + }; |
| + |
| +}; |
| + |
| + |
| +} // experimental_declarative |
| +} // api |
| +} // extensions |
| + |
| +#endif // CHROME_COMMON_EXTENSIONS_API_EXPERIMENTAL_DECLARATIVE_H__ |