| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 360 |
| 361 uint32_t RenderWidgetHostViewChildFrame::GetSurfaceIdNamespace() { | 361 uint32_t RenderWidgetHostViewChildFrame::GetSurfaceIdNamespace() { |
| 362 if (!use_surfaces_) | 362 if (!use_surfaces_) |
| 363 return 0; | 363 return 0; |
| 364 | 364 |
| 365 return id_allocator_->id_namespace(); | 365 return id_allocator_->id_namespace(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void RenderWidgetHostViewChildFrame::ProcessKeyboardEvent( | 368 void RenderWidgetHostViewChildFrame::ProcessKeyboardEvent( |
| 369 const NativeWebKeyboardEvent& event) { | 369 const NativeWebKeyboardEvent& event) { |
| 370 if (!host_) |
| 371 return; |
| 372 |
| 370 host_->ForwardKeyboardEvent(event); | 373 host_->ForwardKeyboardEvent(event); |
| 371 } | 374 } |
| 372 | 375 |
| 373 void RenderWidgetHostViewChildFrame::ProcessMouseEvent( | 376 void RenderWidgetHostViewChildFrame::ProcessMouseEvent( |
| 374 const blink::WebMouseEvent& event) { | 377 const blink::WebMouseEvent& event) { |
| 378 if (!host_) |
| 379 return; |
| 380 |
| 375 host_->ForwardMouseEvent(event); | 381 host_->ForwardMouseEvent(event); |
| 376 } | 382 } |
| 377 | 383 |
| 378 void RenderWidgetHostViewChildFrame::ProcessMouseWheelEvent( | 384 void RenderWidgetHostViewChildFrame::ProcessMouseWheelEvent( |
| 379 const blink::WebMouseWheelEvent& event) { | 385 const blink::WebMouseWheelEvent& event) { |
| 386 if (!host_) |
| 387 return; |
| 388 |
| 380 if (event.deltaX != 0 || event.deltaY != 0) | 389 if (event.deltaX != 0 || event.deltaY != 0) |
| 381 host_->ForwardWheelEvent(event); | 390 host_->ForwardWheelEvent(event); |
| 382 } | 391 } |
| 383 | 392 |
| 384 gfx::Point RenderWidgetHostViewChildFrame::TransformPointToRootCoordSpace( | 393 gfx::Point RenderWidgetHostViewChildFrame::TransformPointToRootCoordSpace( |
| 385 const gfx::Point& point) { | 394 const gfx::Point& point) { |
| 386 if (!frame_connector_ || !use_surfaces_) | 395 if (!frame_connector_ || !use_surfaces_) |
| 387 return point; | 396 return point; |
| 388 | 397 |
| 389 return frame_connector_->TransformPointToRootCoordSpace(point, surface_id_); | 398 return frame_connector_->TransformPointToRootCoordSpace(point, surface_id_); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 BrowserAccessibilityManager::GetEmptyDocument(), delegate); | 499 BrowserAccessibilityManager::GetEmptyDocument(), delegate); |
| 491 } | 500 } |
| 492 | 501 |
| 493 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { | 502 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { |
| 494 if (surface_factory_ && !surface_id_.is_null()) | 503 if (surface_factory_ && !surface_id_.is_null()) |
| 495 surface_factory_->Destroy(surface_id_); | 504 surface_factory_->Destroy(surface_id_); |
| 496 surface_id_ = cc::SurfaceId(); | 505 surface_id_ = cc::SurfaceId(); |
| 497 } | 506 } |
| 498 | 507 |
| 499 } // namespace content | 508 } // namespace content |
| OLD | NEW |