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

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

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: Addressed Ben's comments Created 5 years 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/mus/public/cpp/scoped_window_ptr.h"
10 #include "components/mus/public/cpp/window.h"
11 #include "components/mus/public/interfaces/window_tree.mojom.h"
9 #include "content/browser/renderer_host/render_widget_host_view_base.h" 12 #include "content/browser/renderer_host/render_widget_host_view_base.h"
13 #include "content/public/browser/render_process_host_observer.h"
10 14
11 namespace content { 15 namespace content {
12 16
13 class RenderWidgetHost; 17 class RenderWidgetHost;
14 class RenderWidgetHostImpl; 18 class RenderWidgetHostImpl;
15 struct NativeWebKeyboardEvent; 19 struct NativeWebKeyboardEvent;
16 20
17 // See comments in render_widget_host_view.h about this class and its members. 21 // See comments in render_widget_host_view.h about this class and its members.
18 // This version of RenderWidgetHostView is for builds of Chrome that run through 22 // This version of RenderWidgetHostView is for builds of Chrome that run through
19 // the mojo shell and use the Mandoline UI Service (Mus). Mus is responsible for 23 // the mojo shell and use the Mandoline UI Service (Mus). Mus is responsible for
20 // windowing, compositing, and input event dispatch. The purpose of 24 // windowing, compositing, and input event dispatch. The purpose of
21 // RenderWidgetHostViewMus is to manage the mus::Window owned by the content 25 // RenderWidgetHostViewMus is to manage the mus::Window owned by the content
22 // embedder. The browser is the owner of the mus::Window, controlling properties 26 // embedder. The browser is the owner of the mus::Window, controlling properties
23 // such as visibility, and bounds. Some aspects such as input, focus, and cursor 27 // such as visibility, and bounds. Some aspects such as input, focus, and cursor
24 // are managed by Mus directly. Input event routing will be plumbed directly to 28 // are managed by Mus directly. Input event routing will be plumbed directly to
25 // the renderer from Mus. 29 // the renderer from Mus.
26 class CONTENT_EXPORT RenderWidgetHostViewMus : public RenderWidgetHostViewBase { 30 class CONTENT_EXPORT RenderWidgetHostViewMus : public RenderWidgetHostViewBase {
27 public: 31 public:
28 RenderWidgetHostViewMus( 32 RenderWidgetHostViewMus(
33 mus::Window* parent_window,
29 RenderWidgetHostImpl* widget, 34 RenderWidgetHostImpl* widget,
30 base::WeakPtr<RenderWidgetHostViewBase> platform_view); 35 base::WeakPtr<RenderWidgetHostViewBase> platform_view);
31 ~RenderWidgetHostViewMus() override; 36 ~RenderWidgetHostViewMus() override;
32 37
38 void Embed(mus::mojom::WindowTreeClientPtr tree_client);
39
40 RenderWidgetHostViewMus* AsMusView() override;
41
33 private: 42 private:
34 // RenderWidgetHostView implementation. 43 // RenderWidgetHostView implementation.
35 void InitAsChild(gfx::NativeView parent_view) override; 44 void InitAsChild(gfx::NativeView parent_view) override;
36 RenderWidgetHost* GetRenderWidgetHost() const override; 45 RenderWidgetHost* GetRenderWidgetHost() const override;
37 void SetSize(const gfx::Size& size) override; 46 void SetSize(const gfx::Size& size) override;
38 void SetBounds(const gfx::Rect& rect) override; 47 void SetBounds(const gfx::Rect& rect) override;
39 void Focus() override; 48 void Focus() override;
40 bool HasFocus() const override; 49 bool HasFocus() const override;
41 bool IsSurfaceAvailableForCopy() const override; 50 bool IsSurfaceAvailableForCopy() const override;
42 void Show() override; 51 void Show() override;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 void LockCompositingSurface() override; 121 void LockCompositingSurface() override;
113 void UnlockCompositingSurface() override; 122 void UnlockCompositingSurface() override;
114 123
115 #if defined(OS_WIN) 124 #if defined(OS_WIN)
116 void SetParentNativeViewAccessible( 125 void SetParentNativeViewAccessible(
117 gfx::NativeViewAccessible accessible_parent) override; 126 gfx::NativeViewAccessible accessible_parent) override;
118 gfx::NativeViewId GetParentForWindowlessPlugin() const override; 127 gfx::NativeViewId GetParentForWindowlessPlugin() const override;
119 #endif 128 #endif
120 129
121 RenderWidgetHostImpl* host_; 130 RenderWidgetHostImpl* host_;
122 gfx::Size size_; 131 scoped_ptr<mus::ScopedWindowPtr> window_;
123 // The platform view for this RenderWidgetHostView. 132 // The platform view for this RenderWidgetHostView.
124 // RenderWidgetHostViewMus mostly only cares about stuff related to 133 // RenderWidgetHostViewMus mostly only cares about stuff related to
125 // compositing, the rest are directly forwared to this |platform_view_|. 134 // compositing, the rest are directly forwared to this |platform_view_|.
126 base::WeakPtr<RenderWidgetHostViewBase> platform_view_; 135 base::WeakPtr<RenderWidgetHostViewBase> platform_view_;
127 136
128 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMus); 137 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMus);
129 }; 138 };
130 139
131 } // namespace content 140 } // namespace content
132 141
133 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ 142 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698