| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 PathService::Get(base::DIR_MODULE, &shell_dir); | 89 PathService::Get(base::DIR_MODULE, &shell_dir); |
| 90 | 90 |
| 91 system_package_dir_ = | 91 system_package_dir_ = |
| 92 mojo::util::FilePathToFileURL(shell_dir).Resolve(std::string()); | 92 mojo::util::FilePathToFileURL(shell_dir).Resolve(std::string()); |
| 93 system_package_dir_ = | 93 system_package_dir_ = |
| 94 mojo::util::AddTrailingSlashIfNeeded(system_package_dir_); | 94 mojo::util::AddTrailingSlashIfNeeded(system_package_dir_); |
| 95 } | 95 } |
| 96 PackageManager::~PackageManager() {} | 96 PackageManager::~PackageManager() {} |
| 97 | 97 |
| 98 void PackageManager::Initialize(mojo::Shell* shell, const std::string& url, | 98 void PackageManager::Initialize(mojo::Shell* shell, const std::string& url, |
| 99 uint32_t id) {} | 99 uint32_t id, uint32_t user_id) {} |
| 100 | 100 |
| 101 bool PackageManager::AcceptConnection(mojo::Connection* connection) { | 101 bool PackageManager::AcceptConnection(mojo::Connection* connection) { |
| 102 connection->AddInterface<mojom::Catalog>(this); | 102 connection->AddInterface<mojom::Catalog>(this); |
| 103 connection->AddInterface<mojom::Resolver>(this); | 103 connection->AddInterface<mojom::Resolver>(this); |
| 104 if (connection->GetRemoteApplicationURL() == "mojo://shell/") | 104 if (connection->GetRemoteApplicationURL() == "mojo://shell/") |
| 105 connection->AddInterface<mojom::ShellResolver>(this); | 105 connection->AddInterface<mojom::ShellResolver>(this); |
| 106 return true; | 106 return true; |
| 107 } | 107 } |
| 108 | 108 |
| 109 void PackageManager::Create(mojo::Connection* connection, | 109 void PackageManager::Create(mojo::Connection* connection, |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 ApplicationInfo info; | 326 ApplicationInfo info; |
| 327 info.url = url.spec(); | 327 info.url = url.spec(); |
| 328 info.name = url.spec(); | 328 info.name = url.spec(); |
| 329 catalog_[info.url] = info; | 329 catalog_[info.url] = info; |
| 330 } | 330 } |
| 331 SerializeCatalog(); | 331 SerializeCatalog(); |
| 332 CompleteResolveMojoURL(url, qualifier, callback); | 332 CompleteResolveMojoURL(url, qualifier, callback); |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace package_manager | 335 } // namespace package_manager |
| OLD | NEW |