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

Unified Diff: chrome/browser/mojo_runner_state.cc

Issue 1423063004: Allow Chrome to bind an Application request from mojo_runner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@callback
Patch Set: . Created 5 years, 1 month 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: chrome/browser/mojo_runner_state.cc
diff --git a/chrome/browser/mojo_runner_state.cc b/chrome/browser/mojo_runner_state.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6dc298a0781be2b85b77b2a75034da9ef0fca97c
--- /dev/null
+++ b/chrome/browser/mojo_runner_state.cc
@@ -0,0 +1,39 @@
+// 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 "chrome/browser/mojo_runner_state.h"
+
+#include "mojo/application/public/cpp/application_delegate.h"
+#include "mojo/application/public/cpp/application_impl.h"
+#include "mojo/runner/child/runner_connection.h"
+
+class ChromeApplicationDelegate : public mojo::ApplicationDelegate {
+ public:
+ ChromeApplicationDelegate() {}
+ ~ChromeApplicationDelegate() override {}
+
+ private:
+ void Initialize(mojo::ApplicationImpl* application) override {
+ // TODO(beng): Connect to the window manager.
+ }
+ bool ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) override {
+ return false;
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeApplicationDelegate);
+};
+
+MojoRunnerState::MojoRunnerState() {
+ mojo::InterfaceRequest<mojo::Application> application_request;
+ runner_connection_.reset(
+ mojo::runner::RunnerConnection::ConnectToRunner(&application_request));
+ application_delegate_.reset(new ChromeApplicationDelegate);
+ application_impl_.reset(new mojo::ApplicationImpl(
+ application_delegate_.get(), application_request.Pass()));
+ application_impl_->WaitForInitialize();
+}
+
+MojoRunnerState::~MojoRunnerState() {}
+

Powered by Google App Engine
This is Rietveld 408576698