OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TEST_TEST_RENDER_VIEW_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEST_TEST_RENDER_VIEW_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_TEST_TEST_RENDER_VIEW_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_TEST_TEST_RENDER_VIEW_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // TestRenderViewHostView ------------------------------------------------------ | 46 // TestRenderViewHostView ------------------------------------------------------ |
47 | 47 |
48 // Subclass the RenderViewHost's view so that we can call Show(), etc., | 48 // Subclass the RenderViewHost's view so that we can call Show(), etc., |
49 // without having side-effects. | 49 // without having side-effects. |
50 class TestRenderWidgetHostView : public RenderWidgetHostView { | 50 class TestRenderWidgetHostView : public RenderWidgetHostView { |
51 public: | 51 public: |
52 explicit TestRenderWidgetHostView(RenderWidgetHost* rwh); | 52 explicit TestRenderWidgetHostView(RenderWidgetHost* rwh); |
53 virtual ~TestRenderWidgetHostView(); | 53 virtual ~TestRenderWidgetHostView(); |
54 | 54 |
55 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 55 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
56 const gfx::Rect& pos) {} | 56 const gfx::Rect& pos) OVERRIDE {} |
57 virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) {} | 57 virtual void InitAsFullscreen( |
58 virtual RenderWidgetHost* GetRenderWidgetHost() const; | 58 RenderWidgetHostView* reference_host_view) OVERRIDE {} |
59 virtual void DidBecomeSelected() {} | 59 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; |
60 virtual void WasHidden() {} | 60 virtual void DidBecomeSelected() OVERRIDE {} |
61 virtual void SetSize(const gfx::Size& size) {} | 61 virtual void WasHidden() OVERRIDE {} |
62 virtual void SetBounds(const gfx::Rect& rect) {} | 62 virtual void SetSize(const gfx::Size& size) OVERRIDE {} |
63 virtual gfx::NativeView GetNativeView(); | 63 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE {} |
| 64 virtual gfx::NativeView GetNativeView() OVERRIDE; |
64 virtual void MovePluginWindows( | 65 virtual void MovePluginWindows( |
65 const std::vector<webkit::npapi::WebPluginGeometry>& moves) {} | 66 const std::vector<webkit::npapi::WebPluginGeometry>& moves) OVERRIDE {} |
66 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
67 virtual void ForwardMouseEventToRenderer(UINT message, | 68 virtual void ForwardMouseEventToRenderer(UINT message, |
68 WPARAM wparam, | 69 WPARAM wparam, |
69 LPARAM lparam) {} | 70 LPARAM lparam) OVERRIDE {} |
70 #endif | 71 #endif |
71 virtual void Focus() {} | 72 virtual void Focus() OVERRIDE {} |
72 virtual void Blur() {} | 73 virtual void Blur() OVERRIDE {} |
73 virtual bool HasFocus(); | 74 virtual bool HasFocus() OVERRIDE; |
74 virtual void AdvanceFocus(bool reverse) {} | 75 virtual void Show() OVERRIDE; |
75 virtual void Show(); | 76 virtual void Hide() OVERRIDE; |
76 virtual void Hide(); | 77 virtual bool IsShowing() OVERRIDE; |
77 virtual bool IsShowing(); | 78 virtual gfx::Rect GetViewBounds() const OVERRIDE; |
78 virtual gfx::Rect GetViewBounds() const; | 79 virtual void SetIsLoading(bool is_loading) OVERRIDE {} |
79 virtual void SetIsLoading(bool is_loading) {} | 80 virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE {} |
80 virtual void UpdateCursor(const WebCursor& cursor) {} | |
81 virtual void UpdateCursorIfOverSelf() {} | |
82 virtual void ImeUpdateTextInputState(ui::TextInputType state, | 81 virtual void ImeUpdateTextInputState(ui::TextInputType state, |
83 bool can_compose_inline, | 82 bool can_compose_inline, |
84 const gfx::Rect& caret_rect) {} | 83 const gfx::Rect& caret_rect) OVERRIDE {} |
85 virtual void ImeCancelComposition() {} | 84 virtual void ImeCancelComposition() OVERRIDE {} |
86 virtual void DidUpdateBackingStore( | 85 virtual void DidUpdateBackingStore( |
87 const gfx::Rect& scroll_rect, int scroll_dx, int scroll_dy, | 86 const gfx::Rect& scroll_rect, int scroll_dx, int scroll_dy, |
88 const std::vector<gfx::Rect>& rects) {} | 87 const std::vector<gfx::Rect>& rects) OVERRIDE {} |
89 virtual void RenderViewGone(base::TerminationStatus status, | 88 virtual void RenderViewGone(base::TerminationStatus status, |
90 int error_code); | 89 int error_code) OVERRIDE; |
91 virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) { } | 90 virtual void WillDestroyRenderWidget(RenderWidgetHost* rwh) { } |
92 virtual void Destroy() {} | 91 virtual void Destroy() OVERRIDE {} |
93 virtual void PrepareToDestroy() {} | 92 virtual void SetTooltipText(const std::wstring& tooltip_text) OVERRIDE {} |
94 virtual void SetTooltipText(const std::wstring& tooltip_text) {} | 93 virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE; |
95 virtual BackingStore* AllocBackingStore(const gfx::Size& size); | |
96 #if defined(OS_MACOSX) | 94 #if defined(OS_MACOSX) |
97 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) {} | 95 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) OVERRIDE {} |
98 virtual void ShowPopupWithItems(gfx::Rect bounds, | 96 virtual void ShowPopupWithItems(gfx::Rect bounds, |
99 int item_height, | 97 int item_height, |
100 double item_font_size, | 98 double item_font_size, |
101 int selected_item, | 99 int selected_item, |
102 const std::vector<WebMenuItem>& items, | 100 const std::vector<WebMenuItem>& items, |
103 bool right_aligned); | 101 bool right_aligned) OVERRIDE; |
104 virtual gfx::Rect GetViewCocoaBounds() const; | 102 virtual gfx::Rect GetViewCocoaBounds() const OVERRIDE; |
105 virtual gfx::Rect GetRootWindowRect(); | 103 virtual gfx::Rect GetRootWindowRect() OVERRIDE; |
106 virtual void SetActive(bool active); | 104 virtual void SetActive(bool active) OVERRIDE; |
107 virtual void SetWindowVisibility(bool visible) {} | 105 virtual void SetWindowVisibility(bool visible) OVERRIDE {} |
108 virtual void WindowFrameChanged() {} | 106 virtual void WindowFrameChanged() OVERRIDE {} |
109 virtual void PluginFocusChanged(bool focused, int plugin_id); | 107 virtual void PluginFocusChanged(bool focused, int plugin_id) OVERRIDE; |
110 virtual void StartPluginIme(); | 108 virtual void StartPluginIme() OVERRIDE; |
111 virtual bool PostProcessEventForPluginIme( | 109 virtual bool PostProcessEventForPluginIme( |
112 const NativeWebKeyboardEvent& event); | 110 const NativeWebKeyboardEvent& event) OVERRIDE; |
113 virtual gfx::PluginWindowHandle AllocateFakePluginWindowHandle( | 111 virtual gfx::PluginWindowHandle AllocateFakePluginWindowHandle( |
114 bool opaque, | 112 bool opaque, |
115 bool root); | 113 bool root) OVERRIDE; |
116 virtual void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle window); | 114 virtual void DestroyFakePluginWindowHandle( |
| 115 gfx::PluginWindowHandle window) OVERRIDE; |
117 virtual void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window, | 116 virtual void AcceleratedSurfaceSetIOSurface(gfx::PluginWindowHandle window, |
118 int32 width, | 117 int32 width, |
119 int32 height, | 118 int32 height, |
120 uint64 surface_id); | 119 uint64 surface_id) OVERRIDE; |
121 virtual void AcceleratedSurfaceSetTransportDIB( | 120 virtual void AcceleratedSurfaceSetTransportDIB( |
122 gfx::PluginWindowHandle window, | 121 gfx::PluginWindowHandle window, |
123 int32 width, | 122 int32 width, |
124 int32 height, | 123 int32 height, |
125 TransportDIB::Handle transport_dib); | 124 TransportDIB::Handle transport_dib) OVERRIDE; |
126 virtual void AcceleratedSurfaceBuffersSwapped( | 125 virtual void AcceleratedSurfaceBuffersSwapped( |
127 gfx::PluginWindowHandle window, | 126 gfx::PluginWindowHandle window, |
128 uint64 surface_id, | 127 uint64 surface_id, |
129 int renderer_id, | 128 int renderer_id, |
130 int32 route_id, | 129 int32 route_id, |
131 int gpu_host_id, | 130 int gpu_host_id, |
132 uint64 swap_buffers_count); | 131 uint64 swap_buffers_count) OVERRIDE; |
133 virtual void GpuRenderingStateDidChange(); | 132 virtual void GpuRenderingStateDidChange() OVERRIDE; |
134 #elif defined(OS_WIN) | 133 #elif defined(OS_WIN) |
135 virtual void WillWmDestroy(); | 134 virtual void WillWmDestroy() OVERRIDE; |
136 virtual void ShowCompositorHostWindow(bool show); | 135 virtual void ShowCompositorHostWindow(bool show) OVERRIDE; |
137 #endif | 136 #endif |
138 virtual void SetVisuallyDeemphasized(const SkColor* color, bool animate) { } | 137 virtual void SetVisuallyDeemphasized(const SkColor* color, bool animate) { } |
139 | 138 |
140 #if defined(TOUCH_UI) | 139 #if defined(TOUCH_UI) |
141 virtual void AcceleratedSurfaceSetIOSurface( | 140 virtual void AcceleratedSurfaceSetIOSurface( |
142 int32 width, int32 height, uint64 surface_id) { } | 141 int32 width, int32 height, uint64 surface_id) { } |
143 virtual void AcceleratedSurfaceBuffersSwapped(uint64 surface_id) { } | 142 virtual void AcceleratedSurfaceBuffersSwapped(uint64 surface_id) { } |
144 virtual void AcceleratedSurfaceRelease(uint64 surface_id) { } | 143 virtual void AcceleratedSurfaceRelease(uint64 surface_id) { } |
145 #endif | 144 #endif |
146 | 145 |
147 #if defined(TOOLKIT_USES_GTK) | 146 #if defined(TOOLKIT_USES_GTK) |
148 virtual void CreatePluginContainer(gfx::PluginWindowHandle id) { } | 147 virtual void CreatePluginContainer(gfx::PluginWindowHandle id) { } |
149 virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) { } | 148 virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) { } |
150 virtual void AcceleratedCompositingActivated(bool activated) { } | 149 virtual void AcceleratedCompositingActivated(bool activated) { } |
151 #endif | 150 #endif |
152 | 151 |
153 virtual gfx::PluginWindowHandle GetCompositingSurface(); | 152 virtual gfx::PluginWindowHandle GetCompositingSurface() OVERRIDE; |
154 | 153 |
155 bool is_showing() const { return is_showing_; } | 154 bool is_showing() const { return is_showing_; } |
156 | 155 |
157 private: | 156 private: |
158 RenderWidgetHost* rwh_; | 157 RenderWidgetHost* rwh_; |
159 bool is_showing_; | 158 bool is_showing_; |
160 }; | 159 }; |
161 | 160 |
162 // TestRenderViewHost ---------------------------------------------------------- | 161 // TestRenderViewHost ---------------------------------------------------------- |
163 | 162 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 MockRenderProcessHostFactory rph_factory_; | 329 MockRenderProcessHostFactory rph_factory_; |
331 TestRenderViewHostFactory rvh_factory_; | 330 TestRenderViewHostFactory rvh_factory_; |
332 | 331 |
333 private: | 332 private: |
334 scoped_ptr<TestTabContents> contents_; | 333 scoped_ptr<TestTabContents> contents_; |
335 | 334 |
336 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 335 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
337 }; | 336 }; |
338 | 337 |
339 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_TEST_RENDER_VIEW_HOST_H_ | 338 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_TEST_RENDER_VIEW_HOST_H_ |
OLD | NEW |