OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
7 | 7 |
8 #if defined(OS_MACOSX) | 8 #if defined(OS_MACOSX) |
9 #include <OpenGL/OpenGL.h> | 9 #include <OpenGL/OpenGL.h> |
10 #endif | 10 #endif |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 namespace media { | 42 namespace media { |
43 class VideoFrame; | 43 class VideoFrame; |
44 } | 44 } |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 struct WebScreenInfo; | 47 struct WebScreenInfo; |
48 } | 48 } |
49 | 49 |
50 namespace content { | 50 namespace content { |
51 class BrowserAccessibilityManager; | 51 class BrowserAccessibilityManager; |
52 class RenderWidgetHostViewFrameSubscriber; | |
53 class SyntheticGesture; | 52 class SyntheticGesture; |
54 class SyntheticGestureTarget; | 53 class SyntheticGestureTarget; |
55 class WebCursor; | 54 class WebCursor; |
56 struct WebPluginGeometry; | 55 struct WebPluginGeometry; |
57 struct NativeWebKeyboardEvent; | 56 struct NativeWebKeyboardEvent; |
58 | 57 |
59 // Basic implementation shared by concrete RenderWidgetHostView subclasses. | 58 // Basic implementation shared by concrete RenderWidgetHostView subclasses. |
60 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, | 59 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
61 public IPC::Listener { | 60 public IPC::Listener { |
62 public: | 61 public: |
63 virtual ~RenderWidgetHostViewBase(); | 62 virtual ~RenderWidgetHostViewBase(); |
64 | 63 |
65 // RenderWidgetHostView implementation. | 64 // RenderWidgetHostView implementation. |
66 virtual void SetBackground(const SkBitmap& background) OVERRIDE; | 65 virtual void SetBackground(const SkBitmap& background) OVERRIDE; |
67 virtual const SkBitmap& GetBackground() OVERRIDE; | 66 virtual const SkBitmap& GetBackground() OVERRIDE; |
68 virtual bool IsShowingContextMenu() const OVERRIDE; | 67 virtual bool IsShowingContextMenu() const OVERRIDE; |
69 virtual void SetShowingContextMenu(bool showing_menu) OVERRIDE; | 68 virtual void SetShowingContextMenu(bool showing_menu) OVERRIDE; |
70 virtual base::string16 GetSelectedText() const OVERRIDE; | 69 virtual base::string16 GetSelectedText() const OVERRIDE; |
71 virtual bool IsMouseLocked() OVERRIDE; | 70 virtual bool IsMouseLocked() OVERRIDE; |
72 virtual gfx::Size GetVisibleViewportSize() const OVERRIDE; | 71 virtual gfx::Size GetVisibleViewportSize() const OVERRIDE; |
73 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; | 72 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; |
| 73 virtual void BeginFrameSubscription( |
| 74 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) OVERRIDE; |
| 75 virtual void EndFrameSubscription() OVERRIDE; |
74 | 76 |
75 // IPC::Listener implementation: | 77 // IPC::Listener implementation: |
76 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 78 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
77 | 79 |
78 // Called when a mousewheel event was not processed by the renderer. | 80 // Called when a mousewheel event was not processed by the renderer. |
79 // virtual for testing. | 81 // virtual for testing. |
80 virtual void UnhandledWheelEvent(const blink::WebMouseWheelEvent& event); | 82 virtual void UnhandledWheelEvent(const blink::WebMouseWheelEvent& event); |
81 | 83 |
82 // Called by the host when the input flush has completed. | 84 // Called by the host when the input flush has completed. |
83 void OnDidFlushInput(); | 85 void OnDidFlushInput(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 virtual void GestureEventAck(const blink::WebGestureEvent& event, | 137 virtual void GestureEventAck(const blink::WebGestureEvent& event, |
136 InputEventAckState ack_result); | 138 InputEventAckState ack_result); |
137 | 139 |
138 // Create a platform specific SyntheticGestureTarget implementation that will | 140 // Create a platform specific SyntheticGestureTarget implementation that will |
139 // be used to inject synthetic input events. | 141 // be used to inject synthetic input events. |
140 virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget(); | 142 virtual scoped_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget(); |
141 | 143 |
142 // Return true if frame subscription is supported on this platform. | 144 // Return true if frame subscription is supported on this platform. |
143 virtual bool CanSubscribeFrame() const; | 145 virtual bool CanSubscribeFrame() const; |
144 | 146 |
145 // Begin subscribing for presentation events and captured frames. | |
146 // |subscriber| is now owned by this object, it will be called only on the | |
147 // UI thread. | |
148 virtual void BeginFrameSubscription( | |
149 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber); | |
150 | |
151 // End subscribing for frame presentation events. FrameSubscriber will be | |
152 // deleted after this call. | |
153 virtual void EndFrameSubscription(); | |
154 | |
155 // Create a BrowserAccessibilityManager for this view if it's possible to | 147 // Create a BrowserAccessibilityManager for this view if it's possible to |
156 // create one and if one doesn't exist already. Some ports may not create | 148 // create one and if one doesn't exist already. Some ports may not create |
157 // one depending on the current state. | 149 // one depending on the current state. |
158 virtual void CreateBrowserAccessibilityManagerIfNeeded(); | 150 virtual void CreateBrowserAccessibilityManagerIfNeeded(); |
159 | 151 |
160 virtual void OnAccessibilitySetFocus(int acc_obj_id); | 152 virtual void OnAccessibilitySetFocus(int acc_obj_id); |
161 virtual void AccessibilityShowMenu(int acc_obj_id); | 153 virtual void AccessibilityShowMenu(int acc_obj_id); |
162 virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds); | 154 virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds); |
163 | 155 |
164 virtual SkBitmap::Config PreferredReadbackFormat(); | 156 virtual SkBitmap::Config PreferredReadbackFormat(); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 uint32 renderer_frame_number_; | 420 uint32 renderer_frame_number_; |
429 | 421 |
430 base::OneShotTimer<RenderWidgetHostViewBase> flush_input_timer_; | 422 base::OneShotTimer<RenderWidgetHostViewBase> flush_input_timer_; |
431 | 423 |
432 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 424 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
433 }; | 425 }; |
434 | 426 |
435 } // namespace content | 427 } // namespace content |
436 | 428 |
437 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 429 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
OLD | NEW |