| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/render_widget_host_view_mus.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mus.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 8 #include "components/mus/public/cpp/window.h" | 10 #include "components/mus/public/cpp/window.h" |
| 9 #include "components/mus/public/cpp/window_tree_connection.h" | 11 #include "components/mus/public/cpp/window_tree_connection.h" |
| 10 #include "content/browser/mojo/mojo_shell_client_host.h" | 12 #include "content/browser/mojo/mojo_shell_client_host.h" |
| 11 #include "content/browser/renderer_host/render_process_host_impl.h" | 13 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 12 #include "content/browser/renderer_host/render_widget_host_impl.h" | 14 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 13 #include "content/common/render_widget_window_tree_client_factory.mojom.h" | 15 #include "content/common/render_widget_window_tree_client_factory.mojom.h" |
| 14 #include "content/public/common/mojo_shell_connection.h" | 16 #include "content/public/common/mojo_shell_connection.h" |
| 15 #include "mojo/application/public/cpp/application_impl.h" | 17 #include "mojo/application/public/cpp/application_impl.h" |
| 16 #include "ui/aura/client/screen_position_client.h" | 18 #include "ui/aura/client/screen_position_client.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 36 | 38 |
| 37 // Connect to the renderer, pass it a WindowTreeClient interface request | 39 // Connect to the renderer, pass it a WindowTreeClient interface request |
| 38 // and embed that client inside our mus window. | 40 // and embed that client inside our mus window. |
| 39 std::string url = GetMojoApplicationInstanceURL(host_->GetProcess()); | 41 std::string url = GetMojoApplicationInstanceURL(host_->GetProcess()); |
| 40 mojom::RenderWidgetWindowTreeClientFactoryPtr factory; | 42 mojom::RenderWidgetWindowTreeClientFactoryPtr factory; |
| 41 MojoShellConnection::Get()->GetApplication()->ConnectToService(url, &factory); | 43 MojoShellConnection::Get()->GetApplication()->ConnectToService(url, &factory); |
| 42 | 44 |
| 43 mus::mojom::WindowTreeClientPtr window_tree_client; | 45 mus::mojom::WindowTreeClientPtr window_tree_client; |
| 44 factory->CreateWindowTreeClientForRenderWidget( | 46 factory->CreateWindowTreeClientForRenderWidget( |
| 45 host_->GetRoutingID(), mojo::GetProxy(&window_tree_client)); | 47 host_->GetRoutingID(), mojo::GetProxy(&window_tree_client)); |
| 46 mus_window_->window()->Embed(window_tree_client.Pass()); | 48 mus_window_->window()->Embed(std::move(window_tree_client)); |
| 47 } | 49 } |
| 48 | 50 |
| 49 RenderWidgetHostViewMus::~RenderWidgetHostViewMus() {} | 51 RenderWidgetHostViewMus::~RenderWidgetHostViewMus() {} |
| 50 | 52 |
| 51 void RenderWidgetHostViewMus::InternalSetBounds(const gfx::Rect& rect) { | 53 void RenderWidgetHostViewMus::InternalSetBounds(const gfx::Rect& rect) { |
| 52 aura_window_->SetBounds(rect); | 54 aura_window_->SetBounds(rect); |
| 53 gfx::Rect bounds = aura_window_->GetBoundsInRootWindow(); | 55 gfx::Rect bounds = aura_window_->GetBoundsInRootWindow(); |
| 54 mus_window_->window()->SetBounds(bounds); | 56 mus_window_->window()->SetBounds(bounds); |
| 55 host_->WasResized(); | 57 host_->WasResized(); |
| 56 } | 58 } |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 void RenderWidgetHostViewMus::SetParentNativeViewAccessible( | 325 void RenderWidgetHostViewMus::SetParentNativeViewAccessible( |
| 324 gfx::NativeViewAccessible accessible_parent) {} | 326 gfx::NativeViewAccessible accessible_parent) {} |
| 325 | 327 |
| 326 gfx::NativeViewId RenderWidgetHostViewMus::GetParentForWindowlessPlugin() | 328 gfx::NativeViewId RenderWidgetHostViewMus::GetParentForWindowlessPlugin() |
| 327 const { | 329 const { |
| 328 return gfx::NativeViewId(); | 330 return gfx::NativeViewId(); |
| 329 } | 331 } |
| 330 #endif | 332 #endif |
| 331 | 333 |
| 332 } // namespace content | 334 } // namespace content |
| OLD | NEW |