Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Unified Diff: services/ui/launcher/launcher_app.cc

Issue 2003003002: Update launcher API. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/launcher/launcher_app.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/launcher/launcher_app.cc
diff --git a/services/ui/launcher/launcher_app.cc b/services/ui/launcher/launcher_app.cc
index c231ce6c69ca17cdfd3c7a90f99530852d2ed8bc..b29f8316208978fc84d49f44b851cf38955c505a 100644
--- a/services/ui/launcher/launcher_app.cc
+++ b/services/ui/launcher/launcher_app.cc
@@ -105,11 +105,32 @@ bool LauncherApp::ConfigureIncomingConnection(
}
void LauncherApp::Launch(const mojo::String& application_url) {
+ DVLOG(1) << "Launching " << application_url;
+
+ mojo::NativeViewportPtr viewport;
+ mojo::ConnectToService(app_impl_->shell(), "mojo:native_viewport_service",
+ GetProxy(&viewport));
+
+ mojo::ui::ViewProviderPtr view_provider;
+ mojo::ConnectToService(app_impl_->shell(), application_url,
+ GetProxy(&view_provider));
+
+ LaunchInternal(viewport.Pass(), view_provider.Pass());
+}
+void LauncherApp::LaunchOnViewport(
+ mojo::InterfaceHandle<mojo::NativeViewport> viewport,
+ mojo::InterfaceHandle<mojo::ui::ViewProvider> view_provider) {
+ LaunchInternal(mojo::NativeViewportPtr::Create(viewport.Pass()),
+ mojo::ui::ViewProviderPtr::Create(view_provider.Pass()));
+}
+
+void LauncherApp::LaunchInternal(mojo::NativeViewportPtr viewport,
+ mojo::ui::ViewProviderPtr view_provider) {
uint32_t next_id = next_id_++;
std::unique_ptr<LaunchInstance> instance(new LaunchInstance(
- app_impl_, application_url, compositor_.get(), view_manager_.get(),
- base::Bind(&LauncherApp::OnLaunchTermination, base::Unretained(this),
- next_id)));
+ app_impl_, viewport.Pass(), view_provider.Pass(), compositor_.get(),
+ view_manager_.get(), base::Bind(&LauncherApp::OnLaunchTermination,
+ base::Unretained(this), next_id)));
instance->Launch();
launch_instances_.emplace(next_id, std::move(instance));
}
« no previous file with comments | « services/ui/launcher/launcher_app.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698