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

Unified Diff: content/public/test/test_mojo_app.cc

Issue 1149833007: Embed a mojo ApplicationManager in content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Kill ApplicationRegistry Created 5 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: content/public/test/test_mojo_app.cc
diff --git a/content/public/test/test_mojo_app.cc b/content/public/test/test_mojo_app.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bebb7a7623fed5b65f26e55ef6e882471061776e
--- /dev/null
+++ b/content/public/test/test_mojo_app.cc
@@ -0,0 +1,43 @@
+// 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 "content/public/test/test_mojo_app.h"
+
+#include "base/logging.h"
+#include "mojo/application/public/cpp/application_connection.h"
+#include "mojo/application/public/cpp/application_impl.h"
+
+namespace content {
+
+const char kTestMojoAppUrl[] = "system:content_mojo_test";
+
+TestMojoApp::TestMojoApp() : service_binding_(this), app_(nullptr) {
+}
+
+TestMojoApp::~TestMojoApp() {
+}
+
+void TestMojoApp::Initialize(mojo::ApplicationImpl* app) {
+ app_ = app;
+}
+
+bool TestMojoApp::ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) {
+ connection->AddService<TestMojoService>(this);
+ return true;
+}
+
+void TestMojoApp::Create(mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<TestMojoService> request) {
+ DCHECK(!service_binding_.is_bound());
+ service_binding_.Bind(request.Pass());
+}
+
+void TestMojoApp::DoSomething(const DoSomethingCallback& callback) {
+ callback.Run();
+ DCHECK(app_);
+ app_->Terminate();
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698