| 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_TEST_TEST_RENDER_VIEW_HOST_H_ | 5 #ifndef CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ |
| 6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ | 6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // TestRenderViewHostView ------------------------------------------------------ | 49 // TestRenderViewHostView ------------------------------------------------------ |
| 50 | 50 |
| 51 // Subclass the RenderViewHost's view so that we can call Show(), etc., | 51 // Subclass the RenderViewHost's view so that we can call Show(), etc., |
| 52 // without having side-effects. | 52 // without having side-effects. |
| 53 class TestRenderWidgetHostView : public RenderWidgetHostViewBase { | 53 class TestRenderWidgetHostView : public RenderWidgetHostViewBase { |
| 54 public: | 54 public: |
| 55 explicit TestRenderWidgetHostView(RenderWidgetHost* rwh); | 55 explicit TestRenderWidgetHostView(RenderWidgetHost* rwh); |
| 56 virtual ~TestRenderWidgetHostView(); | 56 virtual ~TestRenderWidgetHostView(); |
| 57 | 57 |
| 58 // RenderWidgetHostView implementation. | 58 // RenderWidgetHostView implementation. |
| 59 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE {} | 59 virtual void InitAsChild(gfx::NativeView parent_view) override {} |
| 60 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; | 60 virtual RenderWidgetHost* GetRenderWidgetHost() const override; |
| 61 virtual void SetSize(const gfx::Size& size) OVERRIDE {} | 61 virtual void SetSize(const gfx::Size& size) override {} |
| 62 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE {} | 62 virtual void SetBounds(const gfx::Rect& rect) override {} |
| 63 virtual gfx::Vector2dF GetLastScrollOffset() const OVERRIDE; | 63 virtual gfx::Vector2dF GetLastScrollOffset() const override; |
| 64 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 64 virtual gfx::NativeView GetNativeView() const override; |
| 65 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; | 65 virtual gfx::NativeViewId GetNativeViewId() const override; |
| 66 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; | 66 virtual gfx::NativeViewAccessible GetNativeViewAccessible() override; |
| 67 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; | 67 virtual ui::TextInputClient* GetTextInputClient() override; |
| 68 virtual bool HasFocus() const OVERRIDE; | 68 virtual bool HasFocus() const override; |
| 69 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; | 69 virtual bool IsSurfaceAvailableForCopy() const override; |
| 70 virtual void Show() OVERRIDE; | 70 virtual void Show() override; |
| 71 virtual void Hide() OVERRIDE; | 71 virtual void Hide() override; |
| 72 virtual bool IsShowing() OVERRIDE; | 72 virtual bool IsShowing() override; |
| 73 virtual gfx::Rect GetViewBounds() const OVERRIDE; | 73 virtual gfx::Rect GetViewBounds() const override; |
| 74 #if defined(OS_MACOSX) | 74 #if defined(OS_MACOSX) |
| 75 virtual void SetActive(bool active) OVERRIDE; | 75 virtual void SetActive(bool active) override; |
| 76 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) OVERRIDE {} | 76 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) override {} |
| 77 virtual void SetWindowVisibility(bool visible) OVERRIDE {} | 77 virtual void SetWindowVisibility(bool visible) override {} |
| 78 virtual void WindowFrameChanged() OVERRIDE {} | 78 virtual void WindowFrameChanged() override {} |
| 79 virtual void ShowDefinitionForSelection() OVERRIDE {} | 79 virtual void ShowDefinitionForSelection() override {} |
| 80 virtual bool SupportsSpeech() const OVERRIDE; | 80 virtual bool SupportsSpeech() const override; |
| 81 virtual void SpeakSelection() OVERRIDE; | 81 virtual void SpeakSelection() override; |
| 82 virtual bool IsSpeaking() const OVERRIDE; | 82 virtual bool IsSpeaking() const override; |
| 83 virtual void StopSpeaking() OVERRIDE; | 83 virtual void StopSpeaking() override; |
| 84 #endif // defined(OS_MACOSX) | 84 #endif // defined(OS_MACOSX) |
| 85 virtual void OnSwapCompositorFrame( | 85 virtual void OnSwapCompositorFrame( |
| 86 uint32 output_surface_id, | 86 uint32 output_surface_id, |
| 87 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; | 87 scoped_ptr<cc::CompositorFrame> frame) override; |
| 88 | 88 |
| 89 // RenderWidgetHostViewBase implementation. | 89 // RenderWidgetHostViewBase implementation. |
| 90 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 90 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
| 91 const gfx::Rect& pos) OVERRIDE {} | 91 const gfx::Rect& pos) override {} |
| 92 virtual void InitAsFullscreen( | 92 virtual void InitAsFullscreen( |
| 93 RenderWidgetHostView* reference_host_view) OVERRIDE {} | 93 RenderWidgetHostView* reference_host_view) override {} |
| 94 virtual void WasShown() OVERRIDE {} | 94 virtual void WasShown() override {} |
| 95 virtual void WasHidden() OVERRIDE {} | 95 virtual void WasHidden() override {} |
| 96 virtual void MovePluginWindows( | 96 virtual void MovePluginWindows( |
| 97 const std::vector<WebPluginGeometry>& moves) OVERRIDE {} | 97 const std::vector<WebPluginGeometry>& moves) override {} |
| 98 virtual void Focus() OVERRIDE {} | 98 virtual void Focus() override {} |
| 99 virtual void Blur() OVERRIDE {} | 99 virtual void Blur() override {} |
| 100 virtual void SetIsLoading(bool is_loading) OVERRIDE {} | 100 virtual void SetIsLoading(bool is_loading) override {} |
| 101 virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE {} | 101 virtual void UpdateCursor(const WebCursor& cursor) override {} |
| 102 virtual void TextInputStateChanged( | 102 virtual void TextInputStateChanged( |
| 103 const ViewHostMsg_TextInputState_Params& params) OVERRIDE {} | 103 const ViewHostMsg_TextInputState_Params& params) override {} |
| 104 virtual void ImeCancelComposition() OVERRIDE {} | 104 virtual void ImeCancelComposition() override {} |
| 105 #if defined(OS_MACOSX) || defined(USE_AURA) | 105 #if defined(OS_MACOSX) || defined(USE_AURA) |
| 106 virtual void ImeCompositionRangeChanged( | 106 virtual void ImeCompositionRangeChanged( |
| 107 const gfx::Range& range, | 107 const gfx::Range& range, |
| 108 const std::vector<gfx::Rect>& character_bounds) OVERRIDE {} | 108 const std::vector<gfx::Rect>& character_bounds) override {} |
| 109 #endif | 109 #endif |
| 110 virtual void RenderProcessGone(base::TerminationStatus status, | 110 virtual void RenderProcessGone(base::TerminationStatus status, |
| 111 int error_code) OVERRIDE; | 111 int error_code) override; |
| 112 virtual void Destroy() OVERRIDE; | 112 virtual void Destroy() override; |
| 113 virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE {} | 113 virtual void SetTooltipText(const base::string16& tooltip_text) override {} |
| 114 virtual void SelectionBoundsChanged( | 114 virtual void SelectionBoundsChanged( |
| 115 const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE {} | 115 const ViewHostMsg_SelectionBounds_Params& params) override {} |
| 116 virtual void CopyFromCompositingSurface( | 116 virtual void CopyFromCompositingSurface( |
| 117 const gfx::Rect& src_subrect, | 117 const gfx::Rect& src_subrect, |
| 118 const gfx::Size& dst_size, | 118 const gfx::Size& dst_size, |
| 119 CopyFromCompositingSurfaceCallback& callback, | 119 CopyFromCompositingSurfaceCallback& callback, |
| 120 const SkColorType color_type) OVERRIDE; | 120 const SkColorType color_type) override; |
| 121 virtual void CopyFromCompositingSurfaceToVideoFrame( | 121 virtual void CopyFromCompositingSurfaceToVideoFrame( |
| 122 const gfx::Rect& src_subrect, | 122 const gfx::Rect& src_subrect, |
| 123 const scoped_refptr<media::VideoFrame>& target, | 123 const scoped_refptr<media::VideoFrame>& target, |
| 124 const base::Callback<void(bool)>& callback) OVERRIDE; | 124 const base::Callback<void(bool)>& callback) override; |
| 125 virtual bool CanCopyToVideoFrame() const OVERRIDE; | 125 virtual bool CanCopyToVideoFrame() const override; |
| 126 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; | 126 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) override; |
| 127 #if defined(OS_MACOSX) | 127 #if defined(OS_MACOSX) |
| 128 virtual bool PostProcessEventForPluginIme( | 128 virtual bool PostProcessEventForPluginIme( |
| 129 const NativeWebKeyboardEvent& event) OVERRIDE; | 129 const NativeWebKeyboardEvent& event) override; |
| 130 #endif | 130 #endif |
| 131 #if defined(OS_ANDROID) | 131 #if defined(OS_ANDROID) |
| 132 virtual void LockCompositingSurface() OVERRIDE {} | 132 virtual void LockCompositingSurface() override {} |
| 133 virtual void UnlockCompositingSurface() OVERRIDE {} | 133 virtual void UnlockCompositingSurface() override {} |
| 134 #endif | 134 #endif |
| 135 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE {} | 135 virtual void GetScreenInfo(blink::WebScreenInfo* results) override {} |
| 136 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; | 136 virtual gfx::Rect GetBoundsInRootWindow() override; |
| 137 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; | 137 virtual gfx::GLSurfaceHandle GetCompositingSurface() override; |
| 138 virtual bool LockMouse() OVERRIDE; | 138 virtual bool LockMouse() override; |
| 139 virtual void UnlockMouse() OVERRIDE; | 139 virtual void UnlockMouse() override; |
| 140 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
| 141 virtual void SetParentNativeViewAccessible( | 141 virtual void SetParentNativeViewAccessible( |
| 142 gfx::NativeViewAccessible accessible_parent) OVERRIDE; | 142 gfx::NativeViewAccessible accessible_parent) override; |
| 143 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const OVERRIDE; | 143 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const override; |
| 144 #endif | 144 #endif |
| 145 | 145 |
| 146 bool is_showing() const { return is_showing_; } | 146 bool is_showing() const { return is_showing_; } |
| 147 bool did_swap_compositor_frame() const { return did_swap_compositor_frame_; } | 147 bool did_swap_compositor_frame() const { return did_swap_compositor_frame_; } |
| 148 | 148 |
| 149 protected: | 149 protected: |
| 150 RenderWidgetHostImpl* rwh_; | 150 RenderWidgetHostImpl* rwh_; |
| 151 | 151 |
| 152 private: | 152 private: |
| 153 bool is_showing_; | 153 bool is_showing_; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 RenderViewHostDelegate* delegate, | 204 RenderViewHostDelegate* delegate, |
| 205 RenderWidgetHostDelegate* widget_delegate, | 205 RenderWidgetHostDelegate* widget_delegate, |
| 206 int routing_id, | 206 int routing_id, |
| 207 int main_frame_routing_id, | 207 int main_frame_routing_id, |
| 208 bool swapped_out); | 208 bool swapped_out); |
| 209 virtual ~TestRenderViewHost(); | 209 virtual ~TestRenderViewHost(); |
| 210 | 210 |
| 211 // RenderViewHostTester implementation. Note that CreateRenderView | 211 // RenderViewHostTester implementation. Note that CreateRenderView |
| 212 // is not specified since it is synonymous with the one from | 212 // is not specified since it is synonymous with the one from |
| 213 // RenderViewHostImpl, see below. | 213 // RenderViewHostImpl, see below. |
| 214 virtual void SetContentsMimeType(const std::string& mime_type) OVERRIDE; | 214 virtual void SetContentsMimeType(const std::string& mime_type) override; |
| 215 virtual void SimulateWasHidden() OVERRIDE; | 215 virtual void SimulateWasHidden() override; |
| 216 virtual void SimulateWasShown() OVERRIDE; | 216 virtual void SimulateWasShown() override; |
| 217 | 217 |
| 218 // NOTE: These methods are deprecated and the equivalents in | 218 // NOTE: These methods are deprecated and the equivalents in |
| 219 // TestRenderFrameHost should be used. | 219 // TestRenderFrameHost should be used. |
| 220 virtual void SendNavigate(int page_id, const GURL& url) OVERRIDE; | 220 virtual void SendNavigate(int page_id, const GURL& url) override; |
| 221 virtual void SendFailedNavigate(int page_id, const GURL& url) OVERRIDE; | 221 virtual void SendFailedNavigate(int page_id, const GURL& url) override; |
| 222 virtual void SendNavigateWithTransition( | 222 virtual void SendNavigateWithTransition( |
| 223 int page_id, | 223 int page_id, |
| 224 const GURL& url, | 224 const GURL& url, |
| 225 ui::PageTransition transition) OVERRIDE; | 225 ui::PageTransition transition) override; |
| 226 | 226 |
| 227 // Calls OnNavigate on the RenderViewHost with the given information, | 227 // Calls OnNavigate on the RenderViewHost with the given information, |
| 228 // including a custom original request URL. Sets the rest of the | 228 // including a custom original request URL. Sets the rest of the |
| 229 // parameters in the message to the "typical" values. This is a helper | 229 // parameters in the message to the "typical" values. This is a helper |
| 230 // function for simulating the most common types of loads. | 230 // function for simulating the most common types of loads. |
| 231 void SendNavigateWithOriginalRequestURL( | 231 void SendNavigateWithOriginalRequestURL( |
| 232 int page_id, const GURL& url, const GURL& original_request_url); | 232 int page_id, const GURL& url, const GURL& original_request_url); |
| 233 | 233 |
| 234 void SendNavigateWithFile( | 234 void SendNavigateWithFile( |
| 235 int page_id, const GURL& url, const base::FilePath& file_path); | 235 int page_id, const GURL& url, const base::FilePath& file_path); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 void set_main_render_frame_host(TestRenderFrameHost* rfh) { | 275 void set_main_render_frame_host(TestRenderFrameHost* rfh) { |
| 276 main_render_frame_host_ = rfh; | 276 main_render_frame_host_ = rfh; |
| 277 } | 277 } |
| 278 | 278 |
| 279 // RenderViewHost overrides -------------------------------------------------- | 279 // RenderViewHost overrides -------------------------------------------------- |
| 280 | 280 |
| 281 virtual bool CreateRenderView(const base::string16& frame_name, | 281 virtual bool CreateRenderView(const base::string16& frame_name, |
| 282 int opener_route_id, | 282 int opener_route_id, |
| 283 int proxy_route_id, | 283 int proxy_route_id, |
| 284 int32 max_page_id, | 284 int32 max_page_id, |
| 285 bool window_was_created_with_opener) OVERRIDE; | 285 bool window_was_created_with_opener) override; |
| 286 virtual bool IsRenderViewLive() const OVERRIDE; | 286 virtual bool IsRenderViewLive() const override; |
| 287 virtual bool IsFullscreen() const OVERRIDE; | 287 virtual bool IsFullscreen() const override; |
| 288 | 288 |
| 289 private: | 289 private: |
| 290 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, FilterNavigate); | 290 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, FilterNavigate); |
| 291 | 291 |
| 292 void SendNavigateWithTransitionAndResponseCode(int page_id, | 292 void SendNavigateWithTransitionAndResponseCode(int page_id, |
| 293 const GURL& url, | 293 const GURL& url, |
| 294 ui::PageTransition transition, | 294 ui::PageTransition transition, |
| 295 int response_code); | 295 int response_code); |
| 296 | 296 |
| 297 // Calls OnNavigate on the RenderViewHost with the given information. | 297 // Calls OnNavigate on the RenderViewHost with the given information. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 private: | 375 private: |
| 376 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors> | 376 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors> |
| 377 ScopedSetSupportedScaleFactors; | 377 ScopedSetSupportedScaleFactors; |
| 378 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_; | 378 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_; |
| 379 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); | 379 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); |
| 380 }; | 380 }; |
| 381 | 381 |
| 382 } // namespace content | 382 } // namespace content |
| 383 | 383 |
| 384 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ | 384 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ |
| OLD | NEW |