| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 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 // Helper to retrieve the value of "action_handlers" for the given |
| 19 // |extension|. Returns the empty set if the extension does not have an entry. |
| 20 static std::set<api::app_runtime::ActionType> GetActionHandlers( |
| 21 const Extension* extension); |
| 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 |