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 #include "mojo/services/package_manager/package_manager.h" | 5 #include "mojo/services/package_manager/package_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
10 #include "mojo/common/mojo_scheme_register.h" | 10 #include "mojo/common/mojo_scheme_register.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 system_package_dir_ = | 101 system_package_dir_ = |
102 mojo::util::FilePathToFileURL(shell_dir).Resolve(std::string()); | 102 mojo::util::FilePathToFileURL(shell_dir).Resolve(std::string()); |
103 system_package_dir_ = | 103 system_package_dir_ = |
104 mojo::util::AddTrailingSlashIfNeeded(system_package_dir_); | 104 mojo::util::AddTrailingSlashIfNeeded(system_package_dir_); |
105 | 105 |
106 DeserializeCatalog(); | 106 DeserializeCatalog(); |
107 } | 107 } |
108 PackageManager::~PackageManager() {} | 108 PackageManager::~PackageManager() {} |
109 | 109 |
110 void PackageManager::Initialize(mojo::Shell* shell, const std::string& url, | |
111 uint32_t id, uint32_t user_id) {} | |
112 | |
113 bool PackageManager::AcceptConnection(mojo::Connection* connection) { | 110 bool PackageManager::AcceptConnection(mojo::Connection* connection) { |
114 connection->AddInterface<mojom::Catalog>(this); | 111 connection->AddInterface<mojom::Catalog>(this); |
115 connection->AddInterface<mojom::Resolver>(this); | 112 connection->AddInterface<mojom::Resolver>(this); |
116 if (connection->GetRemoteApplicationURL() == "mojo://shell/") | 113 if (connection->GetRemoteApplicationURL() == "mojo://shell/") |
117 connection->AddInterface<mojom::ShellResolver>(this); | 114 connection->AddInterface<mojom::ShellResolver>(this); |
118 return true; | 115 return true; |
119 } | 116 } |
120 | 117 |
121 void PackageManager::Create(mojo::Connection* connection, | 118 void PackageManager::Create(mojo::Connection* connection, |
122 mojom::ResolverRequest request) { | 119 mojom::ResolverRequest request) { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 ApplicationInfo info; | 333 ApplicationInfo info; |
337 info.url = url; | 334 info.url = url; |
338 info.name = url.spec(); | 335 info.name = url.spec(); |
339 catalog_[info.url] = info; | 336 catalog_[info.url] = info; |
340 } | 337 } |
341 SerializeCatalog(); | 338 SerializeCatalog(); |
342 CompleteResolveMojoURL(url, qualifier, callback); | 339 CompleteResolveMojoURL(url, qualifier, callback); |
343 } | 340 } |
344 | 341 |
345 } // namespace package_manager | 342 } // namespace package_manager |
OLD | NEW |