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

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: Rebasing 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
« services/ui/launcher/launcher.mojom ('K') | « 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 d301cc164fece10eae0d1d85fa089aeaa1f30895..3fc82c88e416c405a99e7591c3706277a2130382 100644
--- a/services/ui/launcher/launcher_app.cc
+++ b/services/ui/launcher/launcher_app.cc
@@ -105,11 +105,28 @@ bool LauncherApp::ConfigureIncomingConnection(
}
void LauncherApp::Launch(const mojo::String& application_url) {
+ DVLOG(1) << "Launching" << application_url;
ppi 2016/05/30 09:21:00 Need a space after "Launching"
qsr 2016/05/30 09:37:57 Done.
+
+ mojo::ui::ViewProviderPtr view_provider;
+ mojo::ConnectToService(app_impl_->shell(), application_url,
+ GetProxy(&view_provider));
+
+ LaunchInternal(mojo::NativeViewportPtr(), view_provider.Pass());
ppi 2016/05/30 09:21:00 Should we get the native viewport from mojo:native
qsr 2016/05/30 09:37:57 Done.
+}
+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));
}
« services/ui/launcher/launcher.mojom ('K') | « services/ui/launcher/launcher_app.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698