| 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 #include "content/test/test_render_view_host.h" | 5 #include "content/test/test_render_view_host.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 97 } |
| 98 | 98 |
| 99 ui::TextInputClient* TestRenderWidgetHostView::GetTextInputClient() { | 99 ui::TextInputClient* TestRenderWidgetHostView::GetTextInputClient() { |
| 100 return &text_input_client_; | 100 return &text_input_client_; |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool TestRenderWidgetHostView::HasFocus() const { | 103 bool TestRenderWidgetHostView::HasFocus() const { |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool TestRenderWidgetHostView::IsSurfaceAvailableForCopy() const { | |
| 108 return true; | |
| 109 } | |
| 110 | |
| 111 void TestRenderWidgetHostView::Show() { | 107 void TestRenderWidgetHostView::Show() { |
| 112 is_showing_ = true; | 108 is_showing_ = true; |
| 113 is_occluded_ = false; | 109 is_occluded_ = false; |
| 114 } | 110 } |
| 115 | 111 |
| 116 void TestRenderWidgetHostView::Hide() { | 112 void TestRenderWidgetHostView::Hide() { |
| 117 is_showing_ = false; | 113 is_showing_ = false; |
| 118 } | 114 } |
| 119 | 115 |
| 120 bool TestRenderWidgetHostView::IsShowing() { | 116 bool TestRenderWidgetHostView::IsShowing() { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 133 int error_code) { | 129 int error_code) { |
| 134 delete this; | 130 delete this; |
| 135 } | 131 } |
| 136 | 132 |
| 137 void TestRenderWidgetHostView::Destroy() { delete this; } | 133 void TestRenderWidgetHostView::Destroy() { delete this; } |
| 138 | 134 |
| 139 gfx::Rect TestRenderWidgetHostView::GetViewBounds() const { | 135 gfx::Rect TestRenderWidgetHostView::GetViewBounds() const { |
| 140 return gfx::Rect(); | 136 return gfx::Rect(); |
| 141 } | 137 } |
| 142 | 138 |
| 143 void TestRenderWidgetHostView::CopyFromCompositingSurface( | |
| 144 const gfx::Rect& src_subrect, | |
| 145 const gfx::Size& dst_size, | |
| 146 const ReadbackRequestCallback& callback, | |
| 147 const SkColorType preferred_color_type) { | |
| 148 callback.Run(SkBitmap(), content::READBACK_FAILED); | |
| 149 } | |
| 150 | |
| 151 void TestRenderWidgetHostView::CopyFromCompositingSurfaceToVideoFrame( | |
| 152 const gfx::Rect& src_subrect, | |
| 153 const scoped_refptr<media::VideoFrame>& target, | |
| 154 const base::Callback<void(const gfx::Rect&, bool)>& callback) { | |
| 155 callback.Run(gfx::Rect(), false); | |
| 156 } | |
| 157 | |
| 158 bool TestRenderWidgetHostView::CanCopyToVideoFrame() const { | |
| 159 return false; | |
| 160 } | |
| 161 | |
| 162 bool TestRenderWidgetHostView::HasAcceleratedSurface( | 139 bool TestRenderWidgetHostView::HasAcceleratedSurface( |
| 163 const gfx::Size& desired_size) { | 140 const gfx::Size& desired_size) { |
| 164 return false; | 141 return false; |
| 165 } | 142 } |
| 166 | 143 |
| 167 #if defined(OS_MACOSX) | 144 #if defined(OS_MACOSX) |
| 168 | 145 |
| 169 ui::AcceleratedWidgetMac* TestRenderWidgetHostView::GetAcceleratedWidgetMac() | 146 ui::AcceleratedWidgetMac* TestRenderWidgetHostView::GetAcceleratedWidgetMac() |
| 170 const { | 147 const { |
| 171 return nullptr; | 148 return nullptr; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 304 |
| 328 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { | 305 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { |
| 329 return contents()->GetMainFrame(); | 306 return contents()->GetMainFrame(); |
| 330 } | 307 } |
| 331 | 308 |
| 332 TestWebContents* RenderViewHostImplTestHarness::contents() { | 309 TestWebContents* RenderViewHostImplTestHarness::contents() { |
| 333 return static_cast<TestWebContents*>(web_contents()); | 310 return static_cast<TestWebContents*>(web_contents()); |
| 334 } | 311 } |
| 335 | 312 |
| 336 } // namespace content | 313 } // namespace content |
| OLD | NEW |