| OLD | NEW |
| (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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ | |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "content/browser/renderer_host/render_widget_host_view_base.h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 class RenderWidgetHost; | |
| 14 class RenderWidgetHostImpl; | |
| 15 struct NativeWebKeyboardEvent; | |
| 16 | |
| 17 // 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 | |
| 19 // the mojo shell and use the Mandoline UI Service (Mus). Mus is responsible for | |
| 20 // windowing, compositing, and input event dispatch. The purpose of | |
| 21 // RenderWidgetHostViewMus is to manage the mus::Window owned by the content | |
| 22 // 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 | |
| 24 // are managed by Mus directly. Input event routing will be plumbed directly to | |
| 25 // the renderer from Mus. | |
| 26 class CONTENT_EXPORT RenderWidgetHostViewMus : public RenderWidgetHostViewBase { | |
| 27 public: | |
| 28 RenderWidgetHostViewMus( | |
| 29 RenderWidgetHostImpl* widget, | |
| 30 base::WeakPtr<RenderWidgetHostViewBase> platform_view); | |
| 31 ~RenderWidgetHostViewMus() override; | |
| 32 | |
| 33 private: | |
| 34 // RenderWidgetHostView implementation. | |
| 35 void InitAsChild(gfx::NativeView parent_view) override; | |
| 36 RenderWidgetHost* GetRenderWidgetHost() const override; | |
| 37 void SetSize(const gfx::Size& size) override; | |
| 38 void SetBounds(const gfx::Rect& rect) override; | |
| 39 void Focus() override; | |
| 40 bool HasFocus() const override; | |
| 41 bool IsSurfaceAvailableForCopy() const override; | |
| 42 void Show() override; | |
| 43 void Hide() override; | |
| 44 bool IsShowing() override; | |
| 45 gfx::NativeView GetNativeView() const override; | |
| 46 gfx::NativeViewId GetNativeViewId() const override; | |
| 47 gfx::NativeViewAccessible GetNativeViewAccessible() override; | |
| 48 gfx::Rect GetViewBounds() const override; | |
| 49 gfx::Vector2dF GetLastScrollOffset() const override; | |
| 50 void SetBackgroundColor(SkColor color) override; | |
| 51 gfx::Size GetPhysicalBackingSize() const override; | |
| 52 base::string16 GetSelectedText() const override; | |
| 53 | |
| 54 // RenderWidgetHostViewBase implementation. | |
| 55 void InitAsPopup(RenderWidgetHostView* parent_host_view, | |
| 56 const gfx::Rect& bounds) override; | |
| 57 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; | |
| 58 void MovePluginWindows(const std::vector<WebPluginGeometry>& moves) override; | |
| 59 void UpdateCursor(const WebCursor& cursor) override; | |
| 60 void SetIsLoading(bool is_loading) override; | |
| 61 void TextInputStateChanged( | |
| 62 const ViewHostMsg_TextInputState_Params& params) override; | |
| 63 void ImeCancelComposition() override; | |
| 64 #if defined(OS_MACOSX) || defined(USE_AURA) | |
| 65 void ImeCompositionRangeChanged( | |
| 66 const gfx::Range& range, | |
| 67 const std::vector<gfx::Rect>& character_bounds) override; | |
| 68 #endif | |
| 69 void RenderProcessGone(base::TerminationStatus status, | |
| 70 int error_code) override; | |
| 71 void Destroy() override; | |
| 72 void SetTooltipText(const base::string16& tooltip_text) override; | |
| 73 void SelectionChanged(const base::string16& text, | |
| 74 size_t offset, | |
| 75 const gfx::Range& range) override; | |
| 76 void SelectionBoundsChanged( | |
| 77 const ViewHostMsg_SelectionBounds_Params& params) override; | |
| 78 void CopyFromCompositingSurface( | |
| 79 const gfx::Rect& src_subrect, | |
| 80 const gfx::Size& dst_size, | |
| 81 const ReadbackRequestCallback& callback, | |
| 82 const SkColorType preferred_color_type) override; | |
| 83 void CopyFromCompositingSurfaceToVideoFrame( | |
| 84 const gfx::Rect& src_subrect, | |
| 85 const scoped_refptr<media::VideoFrame>& target, | |
| 86 const base::Callback<void(const gfx::Rect&, bool)>& callback) override; | |
| 87 bool CanCopyToVideoFrame() const override; | |
| 88 bool HasAcceleratedSurface(const gfx::Size& desired_size) override; | |
| 89 void ClearCompositorFrame() override {} | |
| 90 bool LockMouse() override; | |
| 91 void UnlockMouse() override; | |
| 92 void GetScreenInfo(blink::WebScreenInfo* results) override; | |
| 93 bool GetScreenColorProfile(std::vector<char>* color_profile) override; | |
| 94 gfx::Rect GetBoundsInRootWindow() override; | |
| 95 | |
| 96 #if defined(OS_MACOSX) | |
| 97 // RenderWidgetHostView implementation. | |
| 98 void SetActive(bool active) override; | |
| 99 void SetWindowVisibility(bool visible) override; | |
| 100 void WindowFrameChanged() override; | |
| 101 void ShowDefinitionForSelection() override; | |
| 102 bool SupportsSpeech() const override; | |
| 103 void SpeakSelection() override; | |
| 104 bool IsSpeaking() const override; | |
| 105 void StopSpeaking() override; | |
| 106 | |
| 107 // RenderWidgetHostViewBase implementation. | |
| 108 bool PostProcessEventForPluginIme( | |
| 109 const NativeWebKeyboardEvent& event) override; | |
| 110 #endif // defined(OS_MACOSX) | |
| 111 | |
| 112 void LockCompositingSurface() override; | |
| 113 void UnlockCompositingSurface() override; | |
| 114 | |
| 115 #if defined(OS_WIN) | |
| 116 void SetParentNativeViewAccessible( | |
| 117 gfx::NativeViewAccessible accessible_parent) override; | |
| 118 gfx::NativeViewId GetParentForWindowlessPlugin() const override; | |
| 119 #endif | |
| 120 | |
| 121 RenderWidgetHostImpl* host_; | |
| 122 gfx::Size size_; | |
| 123 // The platform view for this RenderWidgetHostView. | |
| 124 // RenderWidgetHostViewMus mostly only cares about stuff related to | |
| 125 // compositing, the rest are directly forwared to this |platform_view_|. | |
| 126 base::WeakPtr<RenderWidgetHostViewBase> platform_view_; | |
| 127 | |
| 128 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMus); | |
| 129 }; | |
| 130 | |
| 131 } // namespace content | |
| 132 | |
| 133 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_MUS_H_ | |
| OLD | NEW |