OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 9 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // content that is embedding it. This is not a platform-specific class; rather, | 21 // content that is embedding it. This is not a platform-specific class; rather, |
22 // the embedding renderer process implements the platform containing the | 22 // the embedding renderer process implements the platform containing the |
23 // widget, and the top-level frame's RenderWidgetHostView will ultimately | 23 // widget, and the top-level frame's RenderWidgetHostView will ultimately |
24 // manage all native widget interaction. | 24 // manage all native widget interaction. |
25 // | 25 // |
26 // See comments in render_widget_host_view.h about this class and its members. | 26 // See comments in render_widget_host_view.h about this class and its members. |
27 class CONTENT_EXPORT RenderWidgetHostViewChildFrame | 27 class CONTENT_EXPORT RenderWidgetHostViewChildFrame |
28 : public RenderWidgetHostViewBase { | 28 : public RenderWidgetHostViewBase { |
29 public: | 29 public: |
30 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); | 30 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget); |
31 virtual ~RenderWidgetHostViewChildFrame(); | 31 ~RenderWidgetHostViewChildFrame() override; |
32 | 32 |
33 void set_cross_process_frame_connector( | 33 void set_cross_process_frame_connector( |
34 CrossProcessFrameConnector* frame_connector) { | 34 CrossProcessFrameConnector* frame_connector) { |
35 frame_connector_ = frame_connector; | 35 frame_connector_ = frame_connector; |
36 } | 36 } |
37 | 37 |
38 // RenderWidgetHostView implementation. | 38 // RenderWidgetHostView implementation. |
39 virtual void InitAsChild(gfx::NativeView parent_view) override; | 39 void InitAsChild(gfx::NativeView parent_view) override; |
40 virtual RenderWidgetHost* GetRenderWidgetHost() const override; | 40 RenderWidgetHost* GetRenderWidgetHost() const override; |
41 virtual void SetSize(const gfx::Size& size) override; | 41 void SetSize(const gfx::Size& size) override; |
42 virtual void SetBounds(const gfx::Rect& rect) override; | 42 void SetBounds(const gfx::Rect& rect) override; |
43 virtual void Focus() override; | 43 void Focus() override; |
44 virtual bool HasFocus() const override; | 44 bool HasFocus() const override; |
45 virtual bool IsSurfaceAvailableForCopy() const override; | 45 bool IsSurfaceAvailableForCopy() const override; |
46 virtual void Show() override; | 46 void Show() override; |
47 virtual void Hide() override; | 47 void Hide() override; |
48 virtual bool IsShowing() override; | 48 bool IsShowing() override; |
49 virtual gfx::Rect GetViewBounds() const override; | 49 gfx::Rect GetViewBounds() const override; |
50 virtual gfx::Vector2dF GetLastScrollOffset() const override; | 50 gfx::Vector2dF GetLastScrollOffset() const override; |
51 virtual gfx::NativeView GetNativeView() const override; | 51 gfx::NativeView GetNativeView() const override; |
52 virtual gfx::NativeViewId GetNativeViewId() const override; | 52 gfx::NativeViewId GetNativeViewId() const override; |
53 virtual gfx::NativeViewAccessible GetNativeViewAccessible() override; | 53 gfx::NativeViewAccessible GetNativeViewAccessible() override; |
54 virtual void SetBackgroundOpaque(bool opaque) override; | 54 void SetBackgroundOpaque(bool opaque) override; |
55 virtual gfx::Size GetPhysicalBackingSize() const override; | 55 gfx::Size GetPhysicalBackingSize() const override; |
56 | 56 |
57 // RenderWidgetHostViewBase implementation. | 57 // RenderWidgetHostViewBase implementation. |
58 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 58 void InitAsPopup(RenderWidgetHostView* parent_host_view, |
59 const gfx::Rect& pos) override; | 59 const gfx::Rect& pos) override; |
60 virtual void InitAsFullscreen( | 60 void InitAsFullscreen(RenderWidgetHostView* reference_host_view) override; |
61 RenderWidgetHostView* reference_host_view) override; | 61 void WasShown() override; |
62 virtual void WasShown() override; | 62 void WasHidden() override; |
63 virtual void WasHidden() override; | 63 void MovePluginWindows(const std::vector<WebPluginGeometry>& moves) override; |
64 virtual void MovePluginWindows( | 64 void Blur() override; |
65 const std::vector<WebPluginGeometry>& moves) override; | 65 void UpdateCursor(const WebCursor& cursor) override; |
66 virtual void Blur() override; | 66 void SetIsLoading(bool is_loading) override; |
67 virtual void UpdateCursor(const WebCursor& cursor) override; | 67 void TextInputTypeChanged(ui::TextInputType type, |
68 virtual void SetIsLoading(bool is_loading) override; | 68 ui::TextInputMode input_mode, |
69 virtual void TextInputTypeChanged(ui::TextInputType type, | 69 bool can_compose_inline) override; |
70 ui::TextInputMode input_mode, | 70 void ImeCancelComposition() override; |
71 bool can_compose_inline) override; | |
72 virtual void ImeCancelComposition() override; | |
73 #if defined(OS_MACOSX) || defined(USE_AURA) | 71 #if defined(OS_MACOSX) || defined(USE_AURA) |
74 virtual void ImeCompositionRangeChanged( | 72 void ImeCompositionRangeChanged( |
75 const gfx::Range& range, | 73 const gfx::Range& range, |
76 const std::vector<gfx::Rect>& character_bounds) override; | 74 const std::vector<gfx::Rect>& character_bounds) override; |
77 #endif | 75 #endif |
78 virtual void RenderProcessGone(base::TerminationStatus status, | 76 void RenderProcessGone(base::TerminationStatus status, |
79 int error_code) override; | 77 int error_code) override; |
80 virtual void Destroy() override; | 78 void Destroy() override; |
81 virtual void SetTooltipText(const base::string16& tooltip_text) override; | 79 void SetTooltipText(const base::string16& tooltip_text) override; |
82 virtual void SelectionChanged(const base::string16& text, | 80 void SelectionChanged(const base::string16& text, |
83 size_t offset, | 81 size_t offset, |
84 const gfx::Range& range) override; | 82 const gfx::Range& range) override; |
85 virtual void SelectionBoundsChanged( | 83 void SelectionBoundsChanged( |
86 const ViewHostMsg_SelectionBounds_Params& params) override; | 84 const ViewHostMsg_SelectionBounds_Params& params) override; |
87 virtual void CopyFromCompositingSurface( | 85 void CopyFromCompositingSurface( |
88 const gfx::Rect& src_subrect, | 86 const gfx::Rect& src_subrect, |
89 const gfx::Size& dst_size, | 87 const gfx::Size& dst_size, |
90 const base::Callback<void(bool, const SkBitmap&)>& callback, | 88 const base::Callback<void(bool, const SkBitmap&)>& callback, |
91 const SkColorType color_type) override; | 89 const SkColorType color_type) override; |
92 virtual void CopyFromCompositingSurfaceToVideoFrame( | 90 void CopyFromCompositingSurfaceToVideoFrame( |
93 const gfx::Rect& src_subrect, | 91 const gfx::Rect& src_subrect, |
94 const scoped_refptr<media::VideoFrame>& target, | 92 const scoped_refptr<media::VideoFrame>& target, |
95 const base::Callback<void(bool)>& callback) override; | 93 const base::Callback<void(bool)>& callback) override; |
96 virtual bool CanCopyToVideoFrame() const override; | 94 bool CanCopyToVideoFrame() const override; |
97 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) override; | 95 bool HasAcceleratedSurface(const gfx::Size& desired_size) override; |
98 virtual void OnSwapCompositorFrame( | 96 void OnSwapCompositorFrame(uint32 output_surface_id, |
99 uint32 output_surface_id, | 97 scoped_ptr<cc::CompositorFrame> frame) override; |
100 scoped_ptr<cc::CompositorFrame> frame) override; | 98 void GetScreenInfo(blink::WebScreenInfo* results) override; |
101 virtual void GetScreenInfo(blink::WebScreenInfo* results) override; | 99 gfx::Rect GetBoundsInRootWindow() override; |
102 virtual gfx::Rect GetBoundsInRootWindow() override; | 100 gfx::GLSurfaceHandle GetCompositingSurface() override; |
103 virtual gfx::GLSurfaceHandle GetCompositingSurface() override; | |
104 #if defined(USE_AURA) | 101 #if defined(USE_AURA) |
105 virtual void ProcessAckedTouchEvent( | 102 virtual void ProcessAckedTouchEvent( |
106 const TouchEventWithLatencyInfo& touch, | 103 const TouchEventWithLatencyInfo& touch, |
107 InputEventAckState ack_result) override; | 104 InputEventAckState ack_result) override; |
108 #endif // defined(USE_AURA) | 105 #endif // defined(USE_AURA) |
109 virtual bool LockMouse() override; | 106 bool LockMouse() override; |
110 virtual void UnlockMouse() override; | 107 void UnlockMouse() override; |
111 | 108 |
112 #if defined(OS_MACOSX) | 109 #if defined(OS_MACOSX) |
113 // RenderWidgetHostView implementation. | 110 // RenderWidgetHostView implementation. |
114 virtual void SetActive(bool active) override; | 111 void SetActive(bool active) override; |
115 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) override; | 112 void SetTakesFocusOnlyOnMouseDown(bool flag) override; |
116 virtual void SetWindowVisibility(bool visible) override; | 113 void SetWindowVisibility(bool visible) override; |
117 virtual void WindowFrameChanged() override; | 114 void WindowFrameChanged() override; |
118 virtual void ShowDefinitionForSelection() override; | 115 void ShowDefinitionForSelection() override; |
119 virtual bool SupportsSpeech() const override; | 116 bool SupportsSpeech() const override; |
120 virtual void SpeakSelection() override; | 117 void SpeakSelection() override; |
121 virtual bool IsSpeaking() const override; | 118 bool IsSpeaking() const override; |
122 virtual void StopSpeaking() override; | 119 void StopSpeaking() override; |
123 | 120 |
124 // RenderWidgetHostViewBase implementation. | 121 // RenderWidgetHostViewBase implementation. |
125 virtual bool PostProcessEventForPluginIme( | 122 bool PostProcessEventForPluginIme( |
126 const NativeWebKeyboardEvent& event) override; | 123 const NativeWebKeyboardEvent& event) override; |
127 #endif // defined(OS_MACOSX) | 124 #endif // defined(OS_MACOSX) |
128 | 125 |
129 // RenderWidgetHostViewBase implementation. | 126 // RenderWidgetHostViewBase implementation. |
130 #if defined(OS_ANDROID) | 127 #if defined(OS_ANDROID) |
131 virtual void LockCompositingSurface() override; | 128 virtual void LockCompositingSurface() override; |
132 virtual void UnlockCompositingSurface() override; | 129 virtual void UnlockCompositingSurface() override; |
133 #endif // defined(OS_ANDROID) | 130 #endif // defined(OS_ANDROID) |
134 | 131 |
135 #if defined(OS_WIN) | 132 #if defined(OS_WIN) |
136 virtual void SetParentNativeViewAccessible( | 133 virtual void SetParentNativeViewAccessible( |
137 gfx::NativeViewAccessible accessible_parent) override; | 134 gfx::NativeViewAccessible accessible_parent) override; |
138 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const override; | 135 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const override; |
139 #endif | 136 #endif |
140 virtual BrowserAccessibilityManager* CreateBrowserAccessibilityManager( | 137 BrowserAccessibilityManager* CreateBrowserAccessibilityManager( |
141 BrowserAccessibilityDelegate* delegate) override; | 138 BrowserAccessibilityDelegate* delegate) override; |
142 | 139 |
143 virtual SkColorType PreferredReadbackFormat() override; | 140 SkColorType PreferredReadbackFormat() override; |
144 | 141 |
145 protected: | 142 protected: |
146 friend class RenderWidgetHostView; | 143 friend class RenderWidgetHostView; |
147 | 144 |
148 // The last scroll offset of the view. | 145 // The last scroll offset of the view. |
149 gfx::Vector2dF last_scroll_offset_; | 146 gfx::Vector2dF last_scroll_offset_; |
150 | 147 |
151 // Members will become private when RenderWidgetHostViewGuest is removed. | 148 // Members will become private when RenderWidgetHostViewGuest is removed. |
152 // The model object. | 149 // The model object. |
153 RenderWidgetHostImpl* host_; | 150 RenderWidgetHostImpl* host_; |
154 | 151 |
155 // frame_connector_ provides a platform abstraction. Messages | 152 // frame_connector_ provides a platform abstraction. Messages |
156 // sent through it are routed to the embedding renderer process. | 153 // sent through it are routed to the embedding renderer process. |
157 CrossProcessFrameConnector* frame_connector_; | 154 CrossProcessFrameConnector* frame_connector_; |
158 | 155 |
159 private: | 156 private: |
160 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); | 157 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); |
161 }; | 158 }; |
162 | 159 |
163 } // namespace content | 160 } // namespace content |
164 | 161 |
165 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 162 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
OLD | NEW |