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

Unified Diff: services/ui/launcher/launch_instance.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
Index: services/ui/launcher/launch_instance.cc
diff --git a/services/ui/launcher/launch_instance.cc b/services/ui/launcher/launch_instance.cc
index 9c65fcd9ca237cac39813f8fec9434415ed73a30..ce3149ed3c5bdaf14d0ec61f5239719b9b5bc811 100644
--- a/services/ui/launcher/launch_instance.cc
+++ b/services/ui/launcher/launch_instance.cc
@@ -12,18 +12,19 @@
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/connect.h"
-#include "mojo/services/ui/views/interfaces/view_provider.mojom.h"
#include "services/ui/launcher/launcher_view_tree.h"
namespace launcher {
LaunchInstance::LaunchInstance(mojo::ApplicationImpl* app_impl,
- const std::string& app_url,
+ mojo::NativeViewportPtr viewport,
+ mojo::ui::ViewProviderPtr view_provider,
mojo::gfx::composition::Compositor* compositor,
mojo::ui::ViewManager* view_manager,
const base::Closure& shutdown_callback)
: app_impl_(app_impl),
- app_url_(app_url),
+ viewport_(viewport.Pass()),
+ view_provider_(view_provider.Pass()),
compositor_(compositor),
view_manager_(view_manager),
shutdown_callback_(shutdown_callback),
@@ -32,21 +33,15 @@ LaunchInstance::LaunchInstance(mojo::ApplicationImpl* app_impl,
LaunchInstance::~LaunchInstance() {}
void LaunchInstance::Launch() {
- DVLOG(1) << "Launching " << app_url_;
TRACE_EVENT0("launcher", __func__);
InitViewport();
- mojo::ui::ViewProviderPtr client_view_provider;
- mojo::ConnectToService(app_impl_->shell(), app_url_,
- GetProxy(&client_view_provider));
-
- client_view_provider->CreateView(GetProxy(&client_view_owner_), nullptr);
+ view_provider_->CreateView(GetProxy(&client_view_owner_), nullptr);
+ view_provider_.reset();
}
void LaunchInstance::InitViewport() {
- mojo::ConnectToService(app_impl_->shell(), "mojo:native_viewport_service",
- GetProxy(&viewport_));
viewport_.set_connection_error_handler(base::Bind(
&LaunchInstance::OnViewportConnectionError, base::Unretained(this)));

Powered by Google App Engine
This is Rietveld 408576698