Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1065)

Side by Side Diff: content/browser/frame_host/cross_process_frame_connector.cc

Issue 2431473003: Intersection Observer support for OOPIF (Closed)
Patch Set: dcheng comments addressed Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 24 matching lines...) Expand all
35 // Notify the view of this object being destroyed, if the view still exists. 35 // Notify the view of this object being destroyed, if the view still exists.
36 set_view(nullptr); 36 set_view(nullptr);
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_ForwardInputEvent, OnForwardInputEvent) 43 IPC_MESSAGE_HANDLER(FrameHostMsg_ForwardInputEvent, OnForwardInputEvent)
44 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameRectChanged, OnFrameRectChanged) 44 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameRectChanged, OnFrameRectChanged)
45 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateViewportIntersection,
46 OnUpdateViewportIntersection)
45 IPC_MESSAGE_HANDLER(FrameHostMsg_VisibilityChanged, OnVisibilityChanged) 47 IPC_MESSAGE_HANDLER(FrameHostMsg_VisibilityChanged, OnVisibilityChanged)
46 IPC_MESSAGE_HANDLER(FrameHostMsg_SatisfySequence, OnSatisfySequence) 48 IPC_MESSAGE_HANDLER(FrameHostMsg_SatisfySequence, OnSatisfySequence)
47 IPC_MESSAGE_HANDLER(FrameHostMsg_RequireSequence, OnRequireSequence) 49 IPC_MESSAGE_HANDLER(FrameHostMsg_RequireSequence, OnRequireSequence)
48 IPC_MESSAGE_UNHANDLED(handled = false) 50 IPC_MESSAGE_UNHANDLED(handled = false)
49 IPC_END_MESSAGE_MAP() 51 IPC_END_MESSAGE_MAP()
50 52
51 return handled; 53 return handled;
52 } 54 }
53 55
54 void CrossProcessFrameConnector::set_view( 56 void CrossProcessFrameConnector::set_view(
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 return; 292 return;
291 } 293 }
292 } 294 }
293 295
294 void CrossProcessFrameConnector::OnFrameRectChanged( 296 void CrossProcessFrameConnector::OnFrameRectChanged(
295 const gfx::Rect& frame_rect) { 297 const gfx::Rect& frame_rect) {
296 if (!frame_rect.size().IsEmpty()) 298 if (!frame_rect.size().IsEmpty())
297 SetRect(frame_rect); 299 SetRect(frame_rect);
298 } 300 }
299 301
302 void CrossProcessFrameConnector::OnUpdateViewportIntersection(
303 const gfx::Rect& viewport_intersection) {
304 if (view_)
305 view_->UpdateViewportIntersection(viewport_intersection);
306 }
307
300 void CrossProcessFrameConnector::OnVisibilityChanged(bool visible) { 308 void CrossProcessFrameConnector::OnVisibilityChanged(bool visible) {
301 if (!view_) 309 if (!view_)
302 return; 310 return;
303 311
304 // If there is an inner WebContents, it should be notified of the change in 312 // If there is an inner WebContents, it should be notified of the change in
305 // the visibility. The Show/Hide methods will not be called if an inner 313 // the visibility. The Show/Hide methods will not be called if an inner
306 // WebContents exists since the corresponding WebContents will itself call 314 // WebContents exists since the corresponding WebContents will itself call
307 // Show/Hide on all the RenderWidgetHostViews (including this) one. 315 // Show/Hide on all the RenderWidgetHostViews (including this) one.
308 if (frame_proxy_in_parent_renderer_->frame_tree_node() 316 if (frame_proxy_in_parent_renderer_->frame_tree_node()
309 ->render_manager() 317 ->render_manager()
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 386
379 if (parent) { 387 if (parent) {
380 return static_cast<RenderWidgetHostViewBase*>( 388 return static_cast<RenderWidgetHostViewBase*>(
381 parent->current_frame_host()->GetView()); 389 parent->current_frame_host()->GetView());
382 } 390 }
383 391
384 return nullptr; 392 return nullptr;
385 } 393 }
386 394
387 } // namespace content 395 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698