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

Unified Diff: chrome/common/extensions/manifest_handlers/automation.h

Issue 377553003: Create a ManifestPermission implementation for Automation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Revert changes to automation_apitest.cc Created 6 years, 5 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 | « no previous file | chrome/common/extensions/manifest_handlers/automation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..43b79592edeeedf8c83b3c6ac7cc92464db724a1 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,20 +33,6 @@ 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:
@@ -49,6 +42,7 @@ struct AutomationInfo : public Extension::ManifestData {
std::vector<InstallWarning>* install_warnings,
base::string16* error);
+ static scoped_ptr<base::Value> ToValue(const AutomationInfo& info);
virtual ~AutomationInfo();
// true if the extension has requested 'desktop' permission.
@@ -62,17 +56,34 @@ 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);
+
+ static scoped_ptr<api::manifest_types::Automation> AsManifestType(
+ const AutomationInfo& info);
+
DISALLOW_COPY_AND_ASSIGN(AutomationInfo);
+ friend class AutomationManifestPermission;
+ friend class AutomationHandler;
+};
+
+// Parses the automation manifest entry.
+class AutomationHandler : public ManifestHandler {
+ public:
+ AutomationHandler();
+ virtual ~AutomationHandler();
+
+ private:
+ // ManifestHandler implementation.
+ virtual bool Parse(Extension* extensions, base::string16* error) OVERRIDE;
+
+ virtual ManifestPermission* CreatePermission() OVERRIDE;
+ virtual ManifestPermission* CreateInitialRequiredPermission(
+ const Extension* extension) OVERRIDE;
+ virtual const std::vector<std::string> Keys() const OVERRIDE;
+
+ DISALLOW_COPY_AND_ASSIGN(AutomationHandler);
};
} // namespace extensions
« no previous file with comments | « no previous file | chrome/common/extensions/manifest_handlers/automation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698