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

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

Issue 2883033003: Propagate inert state to OOPIFs when a modal dialog is active (Closed)
Patch Set: Rebase only Created 3 years, 7 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 26 matching lines...) Expand all
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (visible && 271 if (visible &&
271 !RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()) 272 !RenderWidgetHostImpl::From(view_->GetRenderWidgetHost())
272 ->delegate() 273 ->delegate()
273 ->IsHidden()) { 274 ->IsHidden()) {
274 view_->Show(); 275 view_->Show();
275 } else if (!visible) { 276 } else if (!visible) {
276 view_->Hide(); 277 view_->Hide();
277 } 278 }
278 } 279 }
279 280
281 void CrossProcessFrameConnector::OnSetIsInert(bool inert) {
282 if (view_)
283 view_->SetIsInert(inert);
284 }
285
280 void CrossProcessFrameConnector::SetRect(const gfx::Rect& frame_rect) { 286 void CrossProcessFrameConnector::SetRect(const gfx::Rect& frame_rect) {
281 gfx::Rect old_rect = child_frame_rect_; 287 gfx::Rect old_rect = child_frame_rect_;
282 child_frame_rect_ = frame_rect; 288 child_frame_rect_ = frame_rect;
283 if (view_) { 289 if (view_) {
284 view_->SetBounds(frame_rect); 290 view_->SetBounds(frame_rect);
285 291
286 // Other local root frames nested underneath this one implicitly have their 292 // Other local root frames nested underneath this one implicitly have their
287 // view rects changed when their ancestor is repositioned, and therefore 293 // view rects changed when their ancestor is repositioned, and therefore
288 // need to have their screen rects updated. 294 // need to have their screen rects updated.
289 FrameTreeNode* proxy_node = 295 FrameTreeNode* proxy_node =
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 337
332 if (parent) { 338 if (parent) {
333 return static_cast<RenderWidgetHostViewBase*>( 339 return static_cast<RenderWidgetHostViewBase*>(
334 parent->current_frame_host()->GetView()); 340 parent->current_frame_host()->GetView());
335 } 341 }
336 342
337 return nullptr; 343 return nullptr;
338 } 344 }
339 345
340 } // namespace content 346 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698