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

Side by Side Diff: third_party/WebKit/Source/core/frame/RemoteFrame.cpp

Issue 2883033003: Propagate inert state to OOPIFs when a modal dialog is active (Closed)
Patch Set: Restore earlier approach + UpdateDistribution() Created 3 years, 6 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 "core/frame/RemoteFrame.h" 5 #include "core/frame/RemoteFrame.h"
6 6
7 #include "bindings/core/v8/WindowProxy.h" 7 #include "bindings/core/v8/WindowProxy.h"
8 #include "bindings/core/v8/WindowProxyManager.h" 8 #include "bindings/core/v8/WindowProxyManager.h"
9 #include "core/dom/RemoteSecurityContext.h" 9 #include "core/dom/RemoteSecurityContext.h"
10 #include "core/dom/UserGestureIndicator.h" 10 #include "core/dom/UserGestureIndicator.h"
(...skipping 11 matching lines...) Expand all
22 #include "platform/loader/fetch/ResourceRequest.h" 22 #include "platform/loader/fetch/ResourceRequest.h"
23 #include "platform/weborigin/SecurityPolicy.h" 23 #include "platform/weborigin/SecurityPolicy.h"
24 #include "public/platform/WebLayer.h" 24 #include "public/platform/WebLayer.h"
25 25
26 namespace blink { 26 namespace blink {
27 27
28 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, 28 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client,
29 Page& page, 29 Page& page,
30 FrameOwner* owner) 30 FrameOwner* owner)
31 : Frame(client, page, owner, RemoteWindowProxyManager::Create(*this)), 31 : Frame(client, page, owner, RemoteWindowProxyManager::Create(*this)),
32 security_context_(RemoteSecurityContext::Create()) { 32 security_context_(RemoteSecurityContext::Create()),
33 last_inert_state_(false) {
33 dom_window_ = RemoteDOMWindow::Create(*this); 34 dom_window_ = RemoteDOMWindow::Create(*this);
35 UpdateInertIfPossible();
34 } 36 }
35 37
36 RemoteFrame* RemoteFrame::Create(RemoteFrameClient* client, 38 RemoteFrame* RemoteFrame::Create(RemoteFrameClient* client,
37 Page& page, 39 Page& page,
38 FrameOwner* owner) { 40 FrameOwner* owner) {
39 return new RemoteFrame(client, page, owner); 41 return new RemoteFrame(client, page, owner);
40 } 42 }
41 43
42 RemoteFrame::~RemoteFrame() { 44 RemoteFrame::~RemoteFrame() {
43 DCHECK(!view_); 45 DCHECK(!view_);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 RemoteSecurityContext* RemoteFrame::GetSecurityContext() const { 116 RemoteSecurityContext* RemoteFrame::GetSecurityContext() const {
115 return security_context_.Get(); 117 return security_context_.Get();
116 } 118 }
117 119
118 bool RemoteFrame::ShouldClose() { 120 bool RemoteFrame::ShouldClose() {
119 // TODO(nasko): Implement running the beforeunload handler in the actual 121 // TODO(nasko): Implement running the beforeunload handler in the actual
120 // LocalFrame running in a different process and getting back a real result. 122 // LocalFrame running in a different process and getting back a real result.
121 return true; 123 return true;
122 } 124 }
123 125
126 void RemoteFrame::SetIsInert(bool inert) {
127 if (inert != last_inert_state_)
128 Client()->SetIsInert(inert);
129 last_inert_state_ = inert;
130 }
131
124 void RemoteFrame::SetView(RemoteFrameView* view) { 132 void RemoteFrame::SetView(RemoteFrameView* view) {
125 // Oilpan: as RemoteFrameView performs no finalization actions, 133 // Oilpan: as RemoteFrameView performs no finalization actions,
126 // no explicit Dispose() of it needed here. (cf. LocalFrameView::Dispose().) 134 // no explicit Dispose() of it needed here. (cf. LocalFrameView::Dispose().)
127 view_ = view; 135 view_ = view;
128 } 136 }
129 137
130 void RemoteFrame::CreateView() { 138 void RemoteFrame::CreateView() {
131 // If the RemoteFrame does not have a LocalFrame parent, there's no need to 139 // If the RemoteFrame does not have a LocalFrame parent, there's no need to
132 // create a EmbeddedContentView for it. 140 // create a EmbeddedContentView for it.
133 if (!DeprecatedLocalOwner()) 141 if (!DeprecatedLocalOwner())
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 FrameVector children_to_detach; 173 FrameVector children_to_detach;
166 children_to_detach.ReserveCapacity(Tree().ChildCount()); 174 children_to_detach.ReserveCapacity(Tree().ChildCount());
167 for (Frame* child = Tree().FirstChild(); child; 175 for (Frame* child = Tree().FirstChild(); child;
168 child = child->Tree().NextSibling()) 176 child = child->Tree().NextSibling())
169 children_to_detach.push_back(child); 177 children_to_detach.push_back(child);
170 for (const auto& child : children_to_detach) 178 for (const auto& child : children_to_detach)
171 child->Detach(FrameDetachType::kRemove); 179 child->Detach(FrameDetachType::kRemove);
172 } 180 }
173 181
174 } // namespace blink 182 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698