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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mus.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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
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> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "components/mus/public/cpp/window.h" 10 #include "components/mus/public/cpp/window.h"
11 #include "components/mus/public/cpp/window_tree_connection.h" 11 #include "components/mus/public/cpp/window_tree_connection.h"
12 #include "content/browser/mojo/mojo_shell_client_host.h" 12 #include "content/browser/mojo/mojo_shell_client_host.h"
13 #include "content/browser/renderer_host/render_process_host_impl.h" 13 #include "content/browser/renderer_host/render_process_host_impl.h"
14 #include "content/browser/renderer_host/render_widget_host_impl.h" 14 #include "content/browser/renderer_host/render_widget_host_impl.h"
15 #include "content/common/render_widget_window_tree_client_factory.mojom.h" 15 #include "content/common/render_widget_window_tree_client_factory.mojom.h"
16 #include "content/public/common/mojo_shell_connection.h" 16 #include "content/public/common/mojo_shell_connection.h"
17 #include "mojo/shell/public/cpp/application_impl.h" 17 #include "mojo/shell/public/cpp/shell.h"
18 #include "ui/aura/client/screen_position_client.h" 18 #include "ui/aura/client/screen_position_client.h"
19 #include "ui/aura/window.h" 19 #include "ui/aura/window.h"
20 #include "ui/base/hit_test.h" 20 #include "ui/base/hit_test.h"
21 21
22 namespace blink { 22 namespace blink {
23 struct WebScreenInfo; 23 struct WebScreenInfo;
24 } 24 }
25 25
26 namespace content { 26 namespace content {
27 27
28 RenderWidgetHostViewMus::RenderWidgetHostViewMus(mus::Window* parent_window, 28 RenderWidgetHostViewMus::RenderWidgetHostViewMus(mus::Window* parent_window,
29 RenderWidgetHostImpl* host) 29 RenderWidgetHostImpl* host)
30 : host_(host), aura_window_(nullptr) { 30 : host_(host), aura_window_(nullptr) {
31 DCHECK(parent_window); 31 DCHECK(parent_window);
32 mus::Window* window = parent_window->connection()->NewWindow(); 32 mus::Window* window = parent_window->connection()->NewWindow();
33 window->SetVisible(true); 33 window->SetVisible(true);
34 window->SetBounds(gfx::Rect(300, 300)); 34 window->SetBounds(gfx::Rect(300, 300));
35 parent_window->AddChild(window); 35 parent_window->AddChild(window);
36 mus_window_.reset(new mus::ScopedWindowPtr(window)); 36 mus_window_.reset(new mus::ScopedWindowPtr(window));
37 host_->SetView(this); 37 host_->SetView(this);
38 38
39 // Connect to the renderer, pass it a WindowTreeClient interface request 39 // Connect to the renderer, pass it a WindowTreeClient interface request
40 // and embed that client inside our mus window. 40 // and embed that client inside our mus window.
41 std::string url = GetMojoApplicationInstanceURL(host_->GetProcess()); 41 std::string url = GetMojoApplicationInstanceURL(host_->GetProcess());
42 mojom::RenderWidgetWindowTreeClientFactoryPtr factory; 42 mojom::RenderWidgetWindowTreeClientFactoryPtr factory;
43 MojoShellConnection::Get()->GetApplication()->ConnectToService(url, &factory); 43 MojoShellConnection::Get()->GetShell()->ConnectToService(url, &factory);
44 44
45 mus::mojom::WindowTreeClientPtr window_tree_client; 45 mus::mojom::WindowTreeClientPtr window_tree_client;
46 factory->CreateWindowTreeClientForRenderWidget( 46 factory->CreateWindowTreeClientForRenderWidget(
47 host_->GetRoutingID(), mojo::GetProxy(&window_tree_client)); 47 host_->GetRoutingID(), mojo::GetProxy(&window_tree_client));
48 mus_window_->window()->Embed(std::move(window_tree_client)); 48 mus_window_->window()->Embed(std::move(window_tree_client));
49 } 49 }
50 50
51 RenderWidgetHostViewMus::~RenderWidgetHostViewMus() {} 51 RenderWidgetHostViewMus::~RenderWidgetHostViewMus() {}
52 52
53 void RenderWidgetHostViewMus::InternalSetBounds(const gfx::Rect& rect) { 53 void RenderWidgetHostViewMus::InternalSetBounds(const gfx::Rect& rect) {
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 void RenderWidgetHostViewMus::SetParentNativeViewAccessible( 325 void RenderWidgetHostViewMus::SetParentNativeViewAccessible(
326 gfx::NativeViewAccessible accessible_parent) {} 326 gfx::NativeViewAccessible accessible_parent) {}
327 327
328 gfx::NativeViewId RenderWidgetHostViewMus::GetParentForWindowlessPlugin() 328 gfx::NativeViewId RenderWidgetHostViewMus::GetParentForWindowlessPlugin()
329 const { 329 const {
330 return gfx::NativeViewId(); 330 return gfx::NativeViewId();
331 } 331 }
332 #endif 332 #endif
333 333
334 } // namespace content 334 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/mojo/mojo_shell_client_host.cc ('k') | content/common/mojo/mojo_shell_connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698