OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SERVICES_CATALOG_ENTRY_H_ | 5 #ifndef SERVICES_CATALOG_ENTRY_H_ |
6 #define SERVICES_CATALOG_ENTRY_H_ | 6 #define SERVICES_CATALOG_ENTRY_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void set_capabilities(const shell::CapabilitySpec& capabilities) { | 53 void set_capabilities(const shell::CapabilitySpec& capabilities) { |
54 capabilities_ = capabilities; | 54 capabilities_ = capabilities; |
55 } | 55 } |
56 const Entry* package() const { return package_; } | 56 const Entry* package() const { return package_; } |
57 void set_package(Entry* package) { package_ = package; } | 57 void set_package(Entry* package) { package_ = package; } |
58 | 58 |
59 std::vector<std::unique_ptr<Entry>> TakeChildren() { | 59 std::vector<std::unique_ptr<Entry>> TakeChildren() { |
60 return std::move(children_); | 60 return std::move(children_); |
61 } | 61 } |
62 | 62 |
| 63 bool privileged() const { return privileged_; } |
| 64 void set_privileged(bool privileged) { privileged_ = privileged; } |
| 65 |
63 private: | 66 private: |
64 std::string name_; | 67 std::string name_; |
65 base::FilePath path_; | 68 base::FilePath path_; |
66 std::string qualifier_; | 69 std::string qualifier_; |
67 std::string display_name_; | 70 std::string display_name_; |
68 shell::CapabilitySpec capabilities_; | 71 shell::CapabilitySpec capabilities_; |
69 Entry* package_ = nullptr; | 72 Entry* package_ = nullptr; |
| 73 bool privileged_ = false; |
70 std::vector<std::unique_ptr<Entry>> children_; | 74 std::vector<std::unique_ptr<Entry>> children_; |
71 }; | 75 }; |
72 | 76 |
73 } // namespace catalog | 77 } // namespace catalog |
74 | 78 |
75 namespace mojo { | 79 namespace mojo { |
76 template <> | 80 template <> |
77 struct TypeConverter<shell::mojom::ResolveResultPtr, catalog::Entry> { | 81 struct TypeConverter<shell::mojom::ResolveResultPtr, catalog::Entry> { |
78 static shell::mojom::ResolveResultPtr Convert(const catalog::Entry& input); | 82 static shell::mojom::ResolveResultPtr Convert(const catalog::Entry& input); |
79 }; | 83 }; |
80 | 84 |
81 template<> | 85 template<> |
82 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> { | 86 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> { |
83 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input); | 87 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input); |
84 }; | 88 }; |
85 | 89 |
86 } // namespace mojo | 90 } // namespace mojo |
87 | 91 |
88 #endif // SERVICES_CATALOG_ENTRY_H_ | 92 #endif // SERVICES_CATALOG_ENTRY_H_ |
OLD | NEW |