Chromium Code Reviews| Index: chrome/common/extensions/manifest_handlers/automation.h |
| diff --git a/chrome/common/extensions/manifest_handlers/automation.h b/chrome/common/extensions/manifest_handlers/automation.h |
| index 3890d594258f08d8c2fed7f294e694c2b3bc4890..39808e768729cb69d08a0ca77814219addd32b1e 100644 |
| --- a/chrome/common/extensions/manifest_handlers/automation.h |
| +++ b/chrome/common/extensions/manifest_handlers/automation.h |
| @@ -15,7 +15,14 @@ |
| namespace extensions { |
| +namespace api { |
| +namespace manifest_types { |
| +struct Automation; |
| +} |
| +} |
| + |
| class URLPatternSet; |
| +class AutomationManifestPermission; |
| namespace automation_errors { |
| extern const char kErrorInvalidMatchPattern[]; |
| @@ -26,29 +33,20 @@ extern const char kErrorInvalidMatch[]; |
| extern const char kErrorNoMatchesProvided[]; |
| } |
| -// Parses the automation manifest entry. |
| -class AutomationHandler : public ManifestHandler { |
| - public: |
| - AutomationHandler(); |
| - virtual ~AutomationHandler(); |
| - |
| - virtual bool Parse(Extension* extensions, base::string16* error) OVERRIDE; |
| - |
| - private: |
| - virtual const std::vector<std::string> Keys() const OVERRIDE; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(AutomationHandler); |
| -}; |
| - |
| // The parsed form of the automation manifest entry. |
| struct AutomationInfo : public Extension::ManifestData { |
| public: |
| static const AutomationInfo* Get(const Extension* extension); |
| + static scoped_ptr<AutomationInfo> FromValue(const base::Value& value); |
| static scoped_ptr<AutomationInfo> FromValue( |
| const base::Value& value, |
| std::vector<InstallWarning>* install_warnings, |
| base::string16* error); |
| + static scoped_ptr<const AutomationInfo> Clone(const AutomationInfo& info); |
| + static scoped_ptr<base::Value> ToValue(const AutomationInfo& info); |
|
Devlin
2014/07/18 22:38:51
Could most or all of these be moved to the anonymo
|
| + static scoped_ptr<api::manifest_types::Automation> AsManifestType( |
| + const AutomationInfo& info); |
| virtual ~AutomationInfo(); |
| // true if the extension has requested 'desktop' permission. |
| @@ -62,17 +60,31 @@ struct AutomationInfo : public Extension::ManifestData { |
| // access (false) to the automation tree. |
| const bool interact; |
| - // Whether any matches were specified (false if automation was specified as a |
| - // boolean, or no matches key was provided. |
| - const bool specified_matches; |
| - |
| private: |
| AutomationInfo(); |
| - AutomationInfo(bool desktop, |
| - const URLPatternSet& matches, |
| - bool interact, |
| - bool specified_matches); |
| + AutomationInfo(bool desktop, URLPatternSet matches, bool interact); |
| + |
| DISALLOW_COPY_AND_ASSIGN(AutomationInfo); |
| + friend class AutomationManifestPermission; |
| + friend class AutomationHandler; |
| +}; |
| + |
| +// Parses the automation manifest entry. |
| +class AutomationHandler : public ManifestHandler { |
| + public: |
| + AutomationHandler(); |
| + virtual ~AutomationHandler(); |
| + |
| + virtual bool Parse(Extension* extensions, base::string16* error) OVERRIDE; |
| + |
| + virtual ManifestPermission* CreatePermission() OVERRIDE; |
| + virtual ManifestPermission* CreateInitialRequiredPermission( |
| + const Extension* extension) OVERRIDE; |
| + |
| + private: |
| + virtual const std::vector<std::string> Keys() const OVERRIDE; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AutomationHandler); |
| }; |
| } // namespace extensions |