Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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_API_DECLARATIVE_DECLARATIVE_MANIFEST_DATA_H_ | |
| 6 #define EXTENSIONS_COMMON_API_DECLARATIVE_DECLARATIVE_MANIFEST_DATA_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/memory/linked_ptr.h" | |
| 11 #include "base/strings/string16.h" | |
| 12 #include "extensions/common/api/events.h" | |
| 13 #include "extensions/common/extension.h" | |
| 14 #include "extensions/common/manifest_handler.h" | |
| 15 | |
| 16 namespace extensions { | |
| 17 | |
| 18 // The parsed form of the "event_rules" manifest entry. | |
| 19 class DeclarativeManifestData : public Extension::ManifestData { | |
| 20 public: | |
| 21 typedef extensions::core_api::events::Rule Rule; | |
| 22 | |
| 23 explicit DeclarativeManifestData(); | |
|
not at google - send to devlin
2015/06/08 21:44:58
explicit not needed on a zero-argument constructor
danduong
2015/06/09 01:21:27
Done.
| |
| 24 ~DeclarativeManifestData() override; | |
| 25 | |
| 26 // Gets the DeclarativeManifestData for |extension|, or NULL if none was | |
| 27 // specified. | |
| 28 static DeclarativeManifestData* Get(const Extension* extension); | |
| 29 | |
| 30 // Tries to construct the info based on |value|, as it would have appeared in | |
| 31 // the manifest. Sets |error| and returns an empty scoped_ptr on failure. | |
| 32 static scoped_ptr<DeclarativeManifestData> FromValue(const base::Value& value, | |
| 33 base::string16* error); | |
| 34 | |
| 35 std::vector<linked_ptr<DeclarativeManifestData::Rule>>& RulesForEvent( | |
| 36 const std::string& event); | |
| 37 | |
| 38 private: | |
| 39 std::map<std::string, std::vector<linked_ptr<Rule>>> event_rules_map_; | |
| 40 }; | |
| 41 | |
| 42 } // namespace extensions | |
| 43 | |
| 44 #endif // EXTENSIONS_COMMON_API_DECLARATIVE_DECLARATIVE_MANIFEST_DATA_H_ | |
| OLD | NEW |