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

Side by Side Diff: content/renderer/render_widget_view_mus.cc

Issue 1461243002: [OLD ATTEMPT, DO NOT REVIEW] mustash: Enable connections to mus from the Chrome renderer Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invert connection creation flow. Needs lots of work. 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
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/renderer/render_widget_view_mus.h"
6
7 #include "components/mus/public/interfaces/window_tree.mojom.h"
8 // TODO(fsamuel): This needs to be in common.
9 #include "content/public/common/mojo_shell_connection.h"
10 #include "content/browser/render_widget_view.mojom.h"
Fady Samuel 2015/11/24 04:42:38 Move to common.
11 #include "mojo/application/public/cpp/application_impl.h"
12
13
14 namespace content {
15
16 RenderWidgetViewMus::RenderWidgetViewMus(int routing_id) {
17 fprintf(stderr, ">>>%s\n", __PRETTY_FUNCTION__);
18 mojom::RenderWidgetViewFactoryPtr factory;
19 MojoShellConnection::Get()->GetApplication()->
20 ConnectToService("exe://chrome", &factory);
21 mus::mojom::WindowTreeClientPtr tree_client;
22 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> request =
23 GetProxy(&tree_client);
24 factory->CreateRenderWidgetView(routing_id, tree_client.Pass());
25 mus::WindowTreeConnection::Create(
26 this, request.Pass(),
27 mus::WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED);
28 }
29
30 RenderWidgetViewMus::~RenderWidgetViewMus() {
31 }
32
33
34 void RenderWidgetViewMus::OnConnectionLost(
35 mus::WindowTreeConnection* connection) {
36 delete this;
37 }
38
39 void RenderWidgetViewMus::OnEmbed(mus::Window* root) {
40 fprintf(stderr, ">>>%s\n", __PRETTY_FUNCTION__);
41 root->AddObserver(this);
42 }
43
44 void RenderWidgetViewMus::OnUnembed() {
45 }
46
47 void RenderWidgetViewMus::OnWindowBoundsChanged(mus::Window* window,
48 const gfx::Rect& old_bounds,
49 const gfx::Rect& new_bounds) {
50 }
51
52 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698