Chromium Code Reviews| 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..e17c435c758015924788ae5b3621bc43a58d77de |
| --- /dev/null |
| +++ b/extensions/common/manifest_handlers/action_handlers_handler.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright (c) 2017 The Chromium Authors. All rights reserved. |
|
Devlin
2017/01/17 21:42:01
nit: no (c)
jdufault
2017/01/20 20:31:47
Done.
|
| +// 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 { |
| + // Returns true if the given |extension| has an action handler for |
| + // |action_type|. |
| + static bool HasActionHandler(const Extension* extension, |
| + api::app_runtime::ActionType action_type); |
| + |
| + 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_ |