| 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/cross_process_frame_connector.h" | 5 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| 6 | 6 |
| 7 #include "cc/surfaces/surface.h" | 7 #include "cc/surfaces/surface.h" |
| 8 #include "cc/surfaces/surface_hittest.h" | 8 #include "cc/surfaces/surface_hittest.h" |
| 9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
| 10 #include "content/browser/compositor/surface_utils.h" | 10 #include "content/browser/compositor/surface_utils.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) { | 39 bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) { |
| 40 bool handled = true; | 40 bool handled = true; |
| 41 | 41 |
| 42 IPC_BEGIN_MESSAGE_MAP(CrossProcessFrameConnector, msg) | 42 IPC_BEGIN_MESSAGE_MAP(CrossProcessFrameConnector, msg) |
| 43 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameRectChanged, OnFrameRectChanged) | 43 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameRectChanged, OnFrameRectChanged) |
| 44 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateViewportIntersection, | 44 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateViewportIntersection, |
| 45 OnUpdateViewportIntersection) | 45 OnUpdateViewportIntersection) |
| 46 IPC_MESSAGE_HANDLER(FrameHostMsg_VisibilityChanged, OnVisibilityChanged) | 46 IPC_MESSAGE_HANDLER(FrameHostMsg_VisibilityChanged, OnVisibilityChanged) |
| 47 IPC_MESSAGE_HANDLER(FrameHostMsg_SetIsInert, OnSetIsInert) |
| 47 IPC_MESSAGE_HANDLER(FrameHostMsg_SatisfySequence, OnSatisfySequence) | 48 IPC_MESSAGE_HANDLER(FrameHostMsg_SatisfySequence, OnSatisfySequence) |
| 48 IPC_MESSAGE_HANDLER(FrameHostMsg_RequireSequence, OnRequireSequence) | 49 IPC_MESSAGE_HANDLER(FrameHostMsg_RequireSequence, OnRequireSequence) |
| 49 IPC_MESSAGE_UNHANDLED(handled = false) | 50 IPC_MESSAGE_UNHANDLED(handled = false) |
| 50 IPC_END_MESSAGE_MAP() | 51 IPC_END_MESSAGE_MAP() |
| 51 | 52 |
| 52 return handled; | 53 return handled; |
| 53 } | 54 } |
| 54 | 55 |
| 55 void CrossProcessFrameConnector::set_view( | 56 void CrossProcessFrameConnector::set_view( |
| 56 RenderWidgetHostViewChildFrame* view) { | 57 RenderWidgetHostViewChildFrame* view) { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 if (visible && | 272 if (visible && |
| 272 !RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()) | 273 !RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()) |
| 273 ->delegate() | 274 ->delegate() |
| 274 ->IsHidden()) { | 275 ->IsHidden()) { |
| 275 view_->Show(); | 276 view_->Show(); |
| 276 } else if (!visible) { | 277 } else if (!visible) { |
| 277 view_->Hide(); | 278 view_->Hide(); |
| 278 } | 279 } |
| 279 } | 280 } |
| 280 | 281 |
| 282 void CrossProcessFrameConnector::OnSetIsInert(bool inert) { |
| 283 is_inert_ = inert; |
| 284 if (view_) |
| 285 view_->SetIsInert(); |
| 286 } |
| 287 |
| 281 void CrossProcessFrameConnector::SetRect(const gfx::Rect& frame_rect) { | 288 void CrossProcessFrameConnector::SetRect(const gfx::Rect& frame_rect) { |
| 282 gfx::Rect old_rect = child_frame_rect_; | 289 gfx::Rect old_rect = child_frame_rect_; |
| 283 child_frame_rect_ = frame_rect; | 290 child_frame_rect_ = frame_rect; |
| 284 if (view_) { | 291 if (view_) { |
| 285 view_->SetBounds(frame_rect); | 292 view_->SetBounds(frame_rect); |
| 286 | 293 |
| 287 // Other local root frames nested underneath this one implicitly have their | 294 // Other local root frames nested underneath this one implicitly have their |
| 288 // view rects changed when their ancestor is repositioned, and therefore | 295 // view rects changed when their ancestor is repositioned, and therefore |
| 289 // need to have their screen rects updated. | 296 // need to have their screen rects updated. |
| 290 FrameTreeNode* proxy_node = | 297 FrameTreeNode* proxy_node = |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 343 |
| 337 if (parent) { | 344 if (parent) { |
| 338 return static_cast<RenderWidgetHostViewBase*>( | 345 return static_cast<RenderWidgetHostViewBase*>( |
| 339 parent->current_frame_host()->GetView()); | 346 parent->current_frame_host()->GetView()); |
| 340 } | 347 } |
| 341 | 348 |
| 342 return nullptr; | 349 return nullptr; |
| 343 } | 350 } |
| 344 | 351 |
| 345 } // namespace content | 352 } // namespace content |
| OLD | NEW |