| 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 <set> | 9 #include <set> |
| 9 #include <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "services/catalog/public/interfaces/catalog.mojom.h" | 13 #include "services/catalog/public/interfaces/catalog.mojom.h" |
| 14 #include "services/shell/public/cpp/capabilities.h" | 14 #include "services/shell/public/cpp/capabilities.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class DictionaryValue; | 17 class DictionaryValue; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace catalog { | 20 namespace catalog { |
| 21 | 21 |
| 22 // Static information about an application package known to the Catalog. | 22 // Static information about an application package known to the Catalog. |
| 23 class Entry { | 23 class Entry { |
| 24 public: | 24 public: |
| 25 Entry(); | 25 Entry(); |
| 26 explicit Entry(const std::string& name); | 26 explicit Entry(const std::string& name); |
| 27 explicit Entry(const Entry& other); | 27 explicit Entry(const Entry& other); |
| 28 ~Entry(); | 28 ~Entry(); |
| 29 | 29 |
| 30 scoped_ptr<base::DictionaryValue> Serialize() const; | 30 std::unique_ptr<base::DictionaryValue> Serialize() const; |
| 31 | 31 |
| 32 // If the constructed Entry is a package that provides other Entrys, the | 32 // If the constructed Entry is a package that provides other Entrys, the |
| 33 // caller must assume ownership of the tree of Entrys by enumerating | 33 // caller must assume ownership of the tree of Entrys by enumerating |
| 34 // applications(). | 34 // applications(). |
| 35 static scoped_ptr<Entry> Deserialize(const base::DictionaryValue& value); | 35 static std::unique_ptr<Entry> Deserialize(const base::DictionaryValue& value); |
| 36 | 36 |
| 37 bool ProvidesClass(const std::string& clazz) const; | 37 bool ProvidesClass(const std::string& clazz) const; |
| 38 | 38 |
| 39 bool operator==(const Entry& other) const; | 39 bool operator==(const Entry& other) const; |
| 40 bool operator<(const Entry& other) const; | 40 bool operator<(const Entry& other) const; |
| 41 | 41 |
| 42 const std::string& name() const { return name_; } | 42 const std::string& name() const { return name_; } |
| 43 void set_name(const std::string& name) { name_ = name; } | 43 void set_name(const std::string& name) { name_ = name; } |
| 44 const base::FilePath& path() const { return path_; } | 44 const base::FilePath& path() const { return path_; } |
| 45 void set_path(const base::FilePath& path) { path_ = path; } | 45 void set_path(const base::FilePath& path) { path_ = path; } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 template<> | 78 template<> |
| 79 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> { | 79 struct TypeConverter<catalog::mojom::EntryPtr, catalog::Entry> { |
| 80 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input); | 80 static catalog::mojom::EntryPtr Convert(const catalog::Entry& input); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace mojo | 83 } // namespace mojo |
| 84 | 84 |
| 85 #endif // SERVICES_CATALOG_ENTRY_H_ | 85 #endif // SERVICES_CATALOG_ENTRY_H_ |
| OLD | NEW |