Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // 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.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef EXTENSIONS_COMMON_MANIFEST_HANDLERS_ACTION_HANDLERS_HANDLER_H_ | |
| 6 #define EXTENSIONS_COMMON_MANIFEST_HANDLERS_ACTION_HANDLERS_HANDLER_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "extensions/common/api/app_runtime.h" | |
| 12 #include "extensions/common/extension.h" | |
| 13 #include "extensions/common/manifest_handler.h" | |
| 14 | |
| 15 namespace extensions { | |
| 16 | |
| 17 struct ActionHandlersInfo : public Extension::ManifestData { | |
| 18 // Returns true if the given |extension| has an action handler for | |
| 19 // |action_type|. | |
| 20 static bool HasActionHandler(const Extension* extension, | |
| 21 api::app_runtime::ActionType action_type); | |
| 22 | |
| 23 ActionHandlersInfo(); | |
| 24 ~ActionHandlersInfo() override; | |
| 25 | |
| 26 std::set<api::app_runtime::ActionType> action_handlers; | |
| 27 }; | |
| 28 | |
| 29 // Parses the "action_handlers" manifest key. | |
| 30 class ActionHandlersHandler : public ManifestHandler { | |
| 31 public: | |
| 32 ActionHandlersHandler(); | |
| 33 ~ActionHandlersHandler() override; | |
| 34 | |
| 35 bool Parse(Extension* extension, base::string16* error) override; | |
| 36 | |
| 37 private: | |
| 38 const std::vector<std::string> Keys() const override; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(ActionHandlersHandler); | |
| 41 }; | |
| 42 | |
| 43 } // namespace extensions | |
| 44 | |
| 45 #endif // EXTENSIONS_COMMON_MANIFEST_HANDLERS_ACTION_HANDLERS_HANDLER_H_ | |
| OLD | NEW |