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

Unified Diff: mojo/shell/connect_util.cc

Issue 1351963002: Some more minor cleanup to ApplicationManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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 | « mojo/shell/connect_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/connect_util.cc
diff --git a/mojo/shell/connect_util.cc b/mojo/shell/connect_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0bffc5a49b7f3c3a219ae86d1ae563218dd0972e
--- /dev/null
+++ b/mojo/shell/connect_util.cc
@@ -0,0 +1,30 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/shell/connect_util.h"
+
+#include "mojo/shell/application_manager.h"
+#include "mojo/shell/capability_filter.h"
+#include "mojo/shell/connect_to_application_params.h"
+
+namespace mojo {
+namespace shell {
+
+ScopedMessagePipeHandle ConnectToServiceByName(
+ ApplicationManager* application_manager,
+ const GURL& application_url,
+ const std::string& interface_name) {
+ ServiceProviderPtr services;
+ scoped_ptr<ConnectToApplicationParams> params(new ConnectToApplicationParams);
+ params->SetURLInfo(application_url);
+ params->set_services(GetProxy(&services));
+ params->set_filter(GetPermissiveCapabilityFilter());
+ application_manager->ConnectToApplication(params.Pass());
+ MessagePipe pipe;
+ services->ConnectToService(interface_name, pipe.handle1.Pass());
+ return pipe.handle0.Pass();
+}
+
+} // namespace shell
+} // namespace mojo
« no previous file with comments | « mojo/shell/connect_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698