| 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 MOJO_SERVICES_PACKAGE_MANAGER_PACKAGE_MANAGER_H_ | 5 #ifndef MOJO_SERVICES_PACKAGE_MANAGER_PACKAGE_MANAGER_H_ |
| 6 #define MOJO_SERVICES_PACKAGE_MANAGER_PACKAGE_MANAGER_H_ | 6 #define MOJO_SERVICES_PACKAGE_MANAGER_PACKAGE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "mojo/public/cpp/bindings/binding_set.h" | 12 #include "mojo/public/cpp/bindings/binding_set.h" |
| 13 #include "mojo/services/package_manager/public/interfaces/catalog.mojom.h" | 13 #include "mojo/services/package_manager/public/interfaces/catalog.mojom.h" |
| 14 #include "mojo/services/package_manager/public/interfaces/resolver.mojom.h" | 14 #include "mojo/services/package_manager/public/interfaces/resolver.mojom.h" |
| 15 #include "mojo/services/package_manager/public/interfaces/shell_resolver.mojom.h
" | 15 #include "mojo/services/package_manager/public/interfaces/shell_resolver.mojom.h
" |
| 16 #include "mojo/shell/public/cpp/interface_factory.h" | 16 #include "mojo/shell/public/cpp/interface_factory.h" |
| 17 #include "mojo/shell/public/cpp/shell.h" | |
| 18 #include "mojo/shell/public/cpp/shell_client.h" | 17 #include "mojo/shell/public/cpp/shell_client.h" |
| 19 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 20 | 19 |
| 21 namespace package_manager { | 20 namespace package_manager { |
| 22 // A set of names of interfaces that may be exposed to an application. | 21 // A set of names of interfaces that may be exposed to an application. |
| 23 using AllowedInterfaces = std::set<std::string>; | 22 using AllowedInterfaces = std::set<std::string>; |
| 24 // A map of allowed applications to allowed interface sets. See shell.mojom for | 23 // A map of allowed applications to allowed interface sets. See shell.mojom for |
| 25 // more details. | 24 // more details. |
| 26 using CapabilityFilter = std::map<std::string, AllowedInterfaces>; | 25 using CapabilityFilter = std::map<std::string, AllowedInterfaces>; |
| 27 | 26 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // "standard". | 72 // "standard". |
| 74 PackageManager(base::TaskRunner* blocking_pool, | 73 PackageManager(base::TaskRunner* blocking_pool, |
| 75 bool register_schemes, | 74 bool register_schemes, |
| 76 scoped_ptr<ApplicationCatalogStore> catalog); | 75 scoped_ptr<ApplicationCatalogStore> catalog); |
| 77 ~PackageManager() override; | 76 ~PackageManager() override; |
| 78 | 77 |
| 79 private: | 78 private: |
| 80 using MojoURLAliasMap = std::map<GURL, std::pair<GURL, std::string>>; | 79 using MojoURLAliasMap = std::map<GURL, std::pair<GURL, std::string>>; |
| 81 | 80 |
| 82 // mojo::ShellClient: | 81 // mojo::ShellClient: |
| 83 void Initialize(mojo::Shell* shell, const std::string& url, | |
| 84 uint32_t id, uint32_t user_id) override; | |
| 85 bool AcceptConnection(mojo::Connection* connection) override; | 82 bool AcceptConnection(mojo::Connection* connection) override; |
| 86 | 83 |
| 87 // mojo::InterfaceFactory<mojom::Resolver>: | 84 // mojo::InterfaceFactory<mojom::Resolver>: |
| 88 void Create(mojo::Connection* connection, | 85 void Create(mojo::Connection* connection, |
| 89 mojom::ResolverRequest request) override; | 86 mojom::ResolverRequest request) override; |
| 90 | 87 |
| 91 // mojo::InterfaceFactory<mojom::ShellResolver>: | 88 // mojo::InterfaceFactory<mojom::ShellResolver>: |
| 92 void Create(mojo::Connection* connection, | 89 void Create(mojo::Connection* connection, |
| 93 mojom::ShellResolverRequest request) override; | 90 mojom::ShellResolverRequest request) override; |
| 94 | 91 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 MojoURLAliasMap mojo_url_aliases_; | 167 MojoURLAliasMap mojo_url_aliases_; |
| 171 | 168 |
| 172 base::WeakPtrFactory<PackageManager> weak_factory_; | 169 base::WeakPtrFactory<PackageManager> weak_factory_; |
| 173 | 170 |
| 174 DISALLOW_COPY_AND_ASSIGN(PackageManager); | 171 DISALLOW_COPY_AND_ASSIGN(PackageManager); |
| 175 }; | 172 }; |
| 176 | 173 |
| 177 } // namespace package_manager | 174 } // namespace package_manager |
| 178 | 175 |
| 179 #endif // MOJO_SERVICES_PACKAGE_MANAGER_PACKAGE_MANAGER_H_ | 176 #endif // MOJO_SERVICES_PACKAGE_MANAGER_PACKAGE_MANAGER_H_ |
| OLD | NEW |