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

Unified Diff: extensions/common/manifest_handlers/action_handlers_handler.h

Issue 2618493002: Chrome app manifest support for action handlers. (Closed)
Patch Set: Rebase Created 3 years, 11 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
Index: extensions/common/manifest_handlers/action_handlers_handler.h
diff --git a/extensions/common/manifest_handlers/action_handlers_handler.h b/extensions/common/manifest_handlers/action_handlers_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..99e4ed580bc96edd3a70a495265a5200bf08aca9
--- /dev/null
+++ b/extensions/common/manifest_handlers/action_handlers_handler.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2017 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.
+
+#ifndef EXTENSIONS_COMMON_MANIFEST_HANDLERS_ACTION_HANDLERS_HANDLER_H_
+#define EXTENSIONS_COMMON_MANIFEST_HANDLERS_ACTION_HANDLERS_HANDLER_H_
+
+#include <set>
+
+#include "base/macros.h"
+#include "extensions/common/api/app_runtime.h"
+#include "extensions/common/extension.h"
+#include "extensions/common/manifest_handler.h"
+
+namespace extensions {
+
+struct ActionHandlersInfo : public Extension::ManifestData {
+ // Helper to retrieve the value of "action_handlers" for the given
+ // |extension|. Returns the empty set if the extension does not have an entry.
+ static std::set<api::app_runtime::ActionType> GetActionHandlers(
+ const Extension* extension);
+
+ ActionHandlersInfo();
+ ~ActionHandlersInfo() override;
+
+ std::set<api::app_runtime::ActionType> action_handlers;
+};
+
+// Parses the "action_handlers" manifest key.
+class ActionHandlersHandler : public ManifestHandler {
+ public:
+ ActionHandlersHandler();
+ ~ActionHandlersHandler() override;
+
+ bool Parse(Extension* extension, base::string16* error) override;
+
+ private:
+ const std::vector<std::string> Keys() const override;
+
+ DISALLOW_COPY_AND_ASSIGN(ActionHandlersHandler);
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_ACTION_HANDLERS_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698