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_GUEST_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE; | 71 virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE; |
72 virtual void SetIsLoading(bool is_loading) OVERRIDE; | 72 virtual void SetIsLoading(bool is_loading) OVERRIDE; |
73 virtual void TextInputStateChanged( | 73 virtual void TextInputStateChanged( |
74 const ViewHostMsg_TextInputState_Params& params) OVERRIDE; | 74 const ViewHostMsg_TextInputState_Params& params) OVERRIDE; |
75 virtual void ImeCancelComposition() OVERRIDE; | 75 virtual void ImeCancelComposition() OVERRIDE; |
76 #if defined(OS_MACOSX) || defined(USE_AURA) | 76 #if defined(OS_MACOSX) || defined(USE_AURA) |
77 virtual void ImeCompositionRangeChanged( | 77 virtual void ImeCompositionRangeChanged( |
78 const gfx::Range& range, | 78 const gfx::Range& range, |
79 const std::vector<gfx::Rect>& character_bounds) OVERRIDE; | 79 const std::vector<gfx::Rect>& character_bounds) OVERRIDE; |
80 #endif | 80 #endif |
81 virtual void RenderProcessGone(base::TerminationStatus status, | |
82 int error_code) OVERRIDE; | |
83 virtual void Destroy() OVERRIDE; | 81 virtual void Destroy() OVERRIDE; |
84 virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; | 82 virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE; |
85 virtual void SelectionChanged(const base::string16& text, | 83 virtual void SelectionChanged(const base::string16& text, |
86 size_t offset, | 84 size_t offset, |
87 const gfx::Range& range) OVERRIDE; | 85 const gfx::Range& range) OVERRIDE; |
88 virtual void SelectionBoundsChanged( | 86 virtual void SelectionBoundsChanged( |
89 const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE; | 87 const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE; |
90 virtual void CopyFromCompositingSurface( | 88 virtual void CopyFromCompositingSurface( |
91 const gfx::Rect& src_subrect, | 89 const gfx::Rect& src_subrect, |
92 const gfx::Size& dst_size, | 90 const gfx::Size& dst_size, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE; | 143 virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE; |
146 virtual void DispatchGestureEvent(ui::GestureEvent* event) OVERRIDE; | 144 virtual void DispatchGestureEvent(ui::GestureEvent* event) OVERRIDE; |
147 virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE; | 145 virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE; |
148 | 146 |
149 virtual SkColorType PreferredReadbackFormat() OVERRIDE; | 147 virtual SkColorType PreferredReadbackFormat() OVERRIDE; |
150 | 148 |
151 protected: | 149 protected: |
152 friend class RenderWidgetHostView; | 150 friend class RenderWidgetHostView; |
153 | 151 |
154 private: | 152 private: |
155 // Destroys this view without calling |Destroy| on |platform_view_|. | |
156 void DestroyGuestView(); | |
157 | |
158 // Builds and forwards a WebKitGestureEvent to the renderer. | 153 // Builds and forwards a WebKitGestureEvent to the renderer. |
159 bool ForwardGestureEventToRenderer(ui::GestureEvent* gesture); | 154 bool ForwardGestureEventToRenderer(ui::GestureEvent* gesture); |
160 | 155 |
161 // Process all of the given gestures (passes them on to renderer) | 156 // Process all of the given gestures (passes them on to renderer) |
162 void ProcessGestures(ui::GestureRecognizer::Gestures* gestures); | 157 void ProcessGestures(ui::GestureRecognizer::Gestures* gestures); |
163 | 158 |
164 RenderWidgetHostViewBase* GetGuestRenderWidgetHostView() const; | 159 RenderWidgetHostViewBase* GetGuestRenderWidgetHostView() const; |
165 | 160 |
166 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied | 161 // BrowserPluginGuest and RenderWidgetHostViewGuest's lifetimes are not tied |
167 // to one another, therefore we access |guest_| through WeakPtr. | 162 // to one another, therefore we access |guest_| through WeakPtr. |
168 base::WeakPtr<BrowserPluginGuest> guest_; | 163 base::WeakPtr<BrowserPluginGuest> guest_; |
169 gfx::Size size_; | 164 gfx::Size size_; |
170 // The platform view for this RenderWidgetHostView. | 165 // The platform view for this RenderWidgetHostView. |
171 // RenderWidgetHostViewGuest mostly only cares about stuff related to | 166 // RenderWidgetHostViewGuest mostly only cares about stuff related to |
172 // compositing, the rest are directly forwared to this |platform_view_|. | 167 // compositing, the rest are directly forwared to this |platform_view_|. |
173 RenderWidgetHostViewBase* platform_view_; | 168 RenderWidgetHostViewBase* platform_view_; |
174 #if defined(USE_AURA) | 169 #if defined(USE_AURA) |
175 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_; | 170 scoped_ptr<ui::GestureRecognizer> gesture_recognizer_; |
176 #endif | 171 #endif |
177 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); | 172 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewGuest); |
178 }; | 173 }; |
179 | 174 |
180 } // namespace content | 175 } // namespace content |
181 | 176 |
182 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ | 177 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_GUEST_H_ |
OLD | NEW |