OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "shell/application_manager/application_manager.h" | 5 #include "shell/application_manager/application_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 mojo::ApplicationPtr application; | 265 mojo::ApplicationPtr application; |
266 InterfaceRequest<Application> application_request = | 266 InterfaceRequest<Application> application_request = |
267 mojo::GetProxy(&application); | 267 mojo::GetProxy(&application); |
268 ShellImpl* shell = | 268 ShellImpl* shell = |
269 new ShellImpl(application.Pass(), this, app_identity, on_application_end); | 269 new ShellImpl(application.Pass(), this, app_identity, on_application_end); |
270 identity_to_shell_impl_[app_identity] = make_scoped_ptr(shell); | 270 identity_to_shell_impl_[app_identity] = make_scoped_ptr(shell); |
271 shell->InitializeApplication(mojo::Array<mojo::String>::From(parameters)); | 271 shell->InitializeApplication(mojo::Array<mojo::String>::From(parameters)); |
272 ConnectToClient(shell, resolved_url, requestor_url, services.Pass(), | 272 ConnectToClient(shell, resolved_url, requestor_url, services.Pass(), |
273 exposed_services.Pass()); | 273 exposed_services.Pass()); |
274 return application_request.Pass(); | 274 return application_request; |
275 } | 275 } |
276 | 276 |
277 ShellImpl* ApplicationManager::GetShellImpl(const GURL& url) { | 277 ShellImpl* ApplicationManager::GetShellImpl(const GURL& url) { |
278 const auto& shell_it = identity_to_shell_impl_.find(Identity(url)); | 278 const auto& shell_it = identity_to_shell_impl_.find(Identity(url)); |
279 if (shell_it != identity_to_shell_impl_.end()) | 279 if (shell_it != identity_to_shell_impl_.end()) |
280 return shell_it->second.get(); | 280 return shell_it->second.get(); |
281 return nullptr; | 281 return nullptr; |
282 } | 282 } |
283 | 283 |
284 void ApplicationManager::ConnectToClient( | 284 void ApplicationManager::ConnectToClient( |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 return args_it->second; | 508 return args_it->second; |
509 return std::vector<std::string>(); | 509 return std::vector<std::string>(); |
510 } | 510 } |
511 | 511 |
512 void ApplicationManager::CleanupRunner(NativeRunner* runner) { | 512 void ApplicationManager::CleanupRunner(NativeRunner* runner) { |
513 native_runners_.erase( | 513 native_runners_.erase( |
514 std::find(native_runners_.begin(), native_runners_.end(), runner)); | 514 std::find(native_runners_.begin(), native_runners_.end(), runner)); |
515 } | 515 } |
516 | 516 |
517 } // namespace shell | 517 } // namespace shell |
OLD | NEW |