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

Side by Side 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: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/public/test/test_mojo_app.h"
6
7 #include "base/logging.h"
8 #include "mojo/application/public/cpp/application_connection.h"
9 #include "mojo/application/public/cpp/application_impl.h"
10
11 namespace content {
12
13 const char kTestMojoAppUrl[] = "system:content_mojo_test";
14
15 TestMojoApp::TestMojoApp() : service_binding_(this), app_(nullptr) {
16 }
17
18 TestMojoApp::~TestMojoApp() {
19 }
20
21 void TestMojoApp::Initialize(mojo::ApplicationImpl* app) {
22 app_ = app;
23 }
24
25 bool TestMojoApp::ConfigureIncomingConnection(
26 mojo::ApplicationConnection* connection) {
27 connection->AddService<TestMojoService>(this);
28 return true;
29 }
30
31 void TestMojoApp::Create(mojo::ApplicationConnection* connection,
32 mojo::InterfaceRequest<TestMojoService> request) {
33 DCHECK(!service_binding_.is_bound());
34 service_binding_.Bind(request.Pass());
35 }
36
37 void TestMojoApp::DoSomething(const DoSomethingCallback& callback) {
38 callback.Run();
39 DCHECK(app_);
40 app_->Terminate();
41 }
42
43 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698