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

Side by Side Diff: chrome/browser/mojo_runner_state.cc

Issue 1442893002: Move Shell connection to content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@i2
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 unified diff | Download patch
« no previous file with comments | « chrome/browser/mojo_runner_state.h ('k') | chrome/browser/mojo_runner_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/mojo_runner_state.h"
6
7 #include "components/mus/public/interfaces/window_manager.mojom.h"
8 #include "mojo/application/public/cpp/application_delegate.h"
9 #include "mojo/application/public/cpp/application_impl.h"
10 #include "mojo/converters/network/network_type_converters.h"
11 #include "mojo/runner/child/runner_connection.h"
12 #include "ui/views/mus/window_manager_connection.h"
13
14 class ChromeApplicationDelegate : public mojo::ApplicationDelegate {
15 public:
16 ChromeApplicationDelegate() {}
17 ~ChromeApplicationDelegate() override {}
18
19 private:
20 void Initialize(mojo::ApplicationImpl* application) override {
21 mus::mojom::WindowManagerPtr window_manager;
22 application->ConnectToService(
23 mojo::URLRequest::From(std::string("mojo:example_wm")),
24 &window_manager);
25 views::WindowManagerConnection::Create(window_manager.Pass(), application);
26 }
27 bool ConfigureIncomingConnection(
28 mojo::ApplicationConnection* connection) override {
29 return false;
30 }
31
32 DISALLOW_COPY_AND_ASSIGN(ChromeApplicationDelegate);
33 };
34
35 MojoRunnerState::MojoRunnerState() {}
36 MojoRunnerState::~MojoRunnerState() {}
37
38 void MojoRunnerState::WaitForConnection() {
39 mojo::InterfaceRequest<mojo::Application> application_request;
40 runner_connection_.reset(
41 mojo::runner::RunnerConnection::ConnectToRunner(&application_request));
42 application_delegate_.reset(new ChromeApplicationDelegate);
43 application_impl_.reset(new mojo::ApplicationImpl(
44 application_delegate_.get(), application_request.Pass()));
45 application_impl_->WaitForInitialize();
46 }
OLDNEW
« no previous file with comments | « chrome/browser/mojo_runner_state.h ('k') | chrome/browser/mojo_runner_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698