| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 RenderViewHostDelegate* delegate, | 232 RenderViewHostDelegate* delegate, |
| 233 int32_t main_frame_routing_id, | 233 int32_t main_frame_routing_id, |
| 234 bool swapped_out) | 234 bool swapped_out) |
| 235 : RenderViewHostImpl(instance, | 235 : RenderViewHostImpl(instance, |
| 236 std::move(widget), | 236 std::move(widget), |
| 237 delegate, | 237 delegate, |
| 238 main_frame_routing_id, | 238 main_frame_routing_id, |
| 239 swapped_out, | 239 swapped_out, |
| 240 false /* has_initialized_audio_host */), | 240 false /* has_initialized_audio_host */), |
| 241 delete_counter_(nullptr), | 241 delete_counter_(nullptr), |
| 242 webkit_preferences_changed_counter_(nullptr), |
| 242 opener_frame_route_id_(MSG_ROUTING_NONE) { | 243 opener_frame_route_id_(MSG_ROUTING_NONE) { |
| 243 // TestRenderWidgetHostView installs itself into this->view_ in its | 244 // TestRenderWidgetHostView installs itself into this->view_ in its |
| 244 // constructor, and deletes itself when TestRenderWidgetHostView::Destroy() is | 245 // constructor, and deletes itself when TestRenderWidgetHostView::Destroy() is |
| 245 // called. | 246 // called. |
| 246 new TestRenderWidgetHostView(GetWidget()); | 247 new TestRenderWidgetHostView(GetWidget()); |
| 247 } | 248 } |
| 248 | 249 |
| 249 TestRenderViewHost::~TestRenderViewHost() { | 250 TestRenderViewHost::~TestRenderViewHost() { |
| 250 if (delete_counter_) | 251 if (delete_counter_) |
| 251 ++*delete_counter_; | 252 ++*delete_counter_; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 288 } |
| 288 | 289 |
| 289 void TestRenderViewHost::SimulateWasShown() { | 290 void TestRenderViewHost::SimulateWasShown() { |
| 290 GetWidget()->WasShown(ui::LatencyInfo()); | 291 GetWidget()->WasShown(ui::LatencyInfo()); |
| 291 } | 292 } |
| 292 | 293 |
| 293 WebPreferences TestRenderViewHost::TestComputeWebkitPrefs() { | 294 WebPreferences TestRenderViewHost::TestComputeWebkitPrefs() { |
| 294 return ComputeWebkitPrefs(); | 295 return ComputeWebkitPrefs(); |
| 295 } | 296 } |
| 296 | 297 |
| 298 void TestRenderViewHost::OnWebkitPreferencesChanged() { |
| 299 RenderViewHostImpl::OnWebkitPreferencesChanged(); |
| 300 if (webkit_preferences_changed_counter_) |
| 301 ++*webkit_preferences_changed_counter_; |
| 302 } |
| 303 |
| 297 void TestRenderViewHost::TestOnStartDragging( | 304 void TestRenderViewHost::TestOnStartDragging( |
| 298 const DropData& drop_data) { | 305 const DropData& drop_data) { |
| 299 blink::WebDragOperationsMask drag_operation = blink::WebDragOperationEvery; | 306 blink::WebDragOperationsMask drag_operation = blink::WebDragOperationEvery; |
| 300 DragEventSourceInfo event_info; | 307 DragEventSourceInfo event_info; |
| 301 GetWidget()->OnStartDragging(drop_data, drag_operation, SkBitmap(), | 308 GetWidget()->OnStartDragging(drop_data, drag_operation, SkBitmap(), |
| 302 gfx::Vector2d(), event_info); | 309 gfx::Vector2d(), event_info); |
| 303 } | 310 } |
| 304 | 311 |
| 305 void TestRenderViewHost::TestOnUpdateStateWithFile( | 312 void TestRenderViewHost::TestOnUpdateStateWithFile( |
| 306 const base::FilePath& file_path) { | 313 const base::FilePath& file_path) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 | 346 |
| 340 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { | 347 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { |
| 341 return contents()->GetMainFrame(); | 348 return contents()->GetMainFrame(); |
| 342 } | 349 } |
| 343 | 350 |
| 344 TestWebContents* RenderViewHostImplTestHarness::contents() { | 351 TestWebContents* RenderViewHostImplTestHarness::contents() { |
| 345 return static_cast<TestWebContents*>(web_contents()); | 352 return static_cast<TestWebContents*>(web_contents()); |
| 346 } | 353 } |
| 347 | 354 |
| 348 } // namespace content | 355 } // namespace content |
| OLD | NEW |