| 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 524 |
| 525 gfx::Point RenderWidgetHostViewChildFrame::TransformPointToRootCoordSpace( | 525 gfx::Point RenderWidgetHostViewChildFrame::TransformPointToRootCoordSpace( |
| 526 const gfx::Point& point) { | 526 const gfx::Point& point) { |
| 527 if (!frame_connector_) | 527 if (!frame_connector_) |
| 528 return point; | 528 return point; |
| 529 | 529 |
| 530 return frame_connector_->TransformPointToRootCoordSpace( | 530 return frame_connector_->TransformPointToRootCoordSpace( |
| 531 point, cc::SurfaceId(frame_sink_id_, local_frame_id_)); | 531 point, cc::SurfaceId(frame_sink_id_, local_frame_id_)); |
| 532 } | 532 } |
| 533 | 533 |
| 534 gfx::Point RenderWidgetHostViewChildFrame::TransformPointToLocalCoordSpace( | 534 bool RenderWidgetHostViewChildFrame::TransformPointToLocalCoordSpace( |
| 535 const gfx::Point& point, | 535 const gfx::Point& point, |
| 536 const cc::SurfaceId& original_surface) { | 536 const cc::SurfaceId& original_surface, |
| 537 gfx::Point* transformed_point) { |
| 538 *transformed_point = point; |
| 537 if (!frame_connector_ || local_frame_id_.is_null()) | 539 if (!frame_connector_ || local_frame_id_.is_null()) |
| 538 return point; | 540 return false; |
| 539 | 541 |
| 540 return frame_connector_->TransformPointToLocalCoordSpace( | 542 return frame_connector_->TransformPointToLocalCoordSpace( |
| 541 point, original_surface, cc::SurfaceId(frame_sink_id_, local_frame_id_)); | 543 point, original_surface, cc::SurfaceId(frame_sink_id_, local_frame_id_), |
| 544 transformed_point); |
| 542 } | 545 } |
| 543 | 546 |
| 544 gfx::Point RenderWidgetHostViewChildFrame::TransformPointToCoordSpaceForView( | 547 bool RenderWidgetHostViewChildFrame::TransformPointToCoordSpaceForView( |
| 545 const gfx::Point& point, | 548 const gfx::Point& point, |
| 546 RenderWidgetHostViewBase* target_view) { | 549 RenderWidgetHostViewBase* target_view, |
| 550 gfx::Point* transformed_point) { |
| 547 if (!frame_connector_ || local_frame_id_.is_null() || target_view == this) | 551 if (!frame_connector_ || local_frame_id_.is_null() || target_view == this) |
| 548 return point; | 552 return false; |
| 549 | 553 |
| 550 return frame_connector_->TransformPointToCoordSpaceForView( | 554 return frame_connector_->TransformPointToCoordSpaceForView( |
| 551 point, target_view, cc::SurfaceId(frame_sink_id_, local_frame_id_)); | 555 point, target_view, cc::SurfaceId(frame_sink_id_, local_frame_id_), |
| 556 transformed_point); |
| 552 } | 557 } |
| 553 | 558 |
| 554 bool RenderWidgetHostViewChildFrame::IsRenderWidgetHostViewChildFrame() { | 559 bool RenderWidgetHostViewChildFrame::IsRenderWidgetHostViewChildFrame() { |
| 555 return true; | 560 return true; |
| 556 } | 561 } |
| 557 | 562 |
| 558 #if defined(OS_MACOSX) | 563 #if defined(OS_MACOSX) |
| 559 ui::AcceleratedWidgetMac* | 564 ui::AcceleratedWidgetMac* |
| 560 RenderWidgetHostViewChildFrame::GetAcceleratedWidgetMac() const { | 565 RenderWidgetHostViewChildFrame::GetAcceleratedWidgetMac() const { |
| 561 return nullptr; | 566 return nullptr; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 | 738 |
| 734 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { | 739 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { |
| 735 return true; | 740 return true; |
| 736 } | 741 } |
| 737 | 742 |
| 738 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 743 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
| 739 return cc::SurfaceId(frame_sink_id_, local_frame_id_); | 744 return cc::SurfaceId(frame_sink_id_, local_frame_id_); |
| 740 }; | 745 }; |
| 741 | 746 |
| 742 } // namespace content | 747 } // namespace content |
| OLD | NEW |