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 "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/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 11 matching lines...) Expand all Loading... |
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); |
34 } | 35 } |
35 | 36 |
36 RemoteFrame* RemoteFrame::Create(RemoteFrameClient* client, | 37 RemoteFrame* RemoteFrame::Create(RemoteFrameClient* client, |
37 Page& page, | 38 Page& page, |
38 FrameOwner* owner) { | 39 FrameOwner* owner) { |
39 return new RemoteFrame(client, page, owner); | 40 return new RemoteFrame(client, page, owner); |
40 } | 41 } |
41 | 42 |
42 RemoteFrame::~RemoteFrame() { | 43 RemoteFrame::~RemoteFrame() { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 RemoteSecurityContext* RemoteFrame::GetSecurityContext() const { | 115 RemoteSecurityContext* RemoteFrame::GetSecurityContext() const { |
115 return security_context_.Get(); | 116 return security_context_.Get(); |
116 } | 117 } |
117 | 118 |
118 bool RemoteFrame::ShouldClose() { | 119 bool RemoteFrame::ShouldClose() { |
119 // TODO(nasko): Implement running the beforeunload handler in the actual | 120 // TODO(nasko): Implement running the beforeunload handler in the actual |
120 // LocalFrame running in a different process and getting back a real result. | 121 // LocalFrame running in a different process and getting back a real result. |
121 return true; | 122 return true; |
122 } | 123 } |
123 | 124 |
| 125 void RemoteFrame::SetIsInert(bool inert) { |
| 126 if (inert != last_inert_state_) |
| 127 Client()->SetIsInert(inert); |
| 128 last_inert_state_ = inert; |
| 129 } |
| 130 |
124 void RemoteFrame::SetView(RemoteFrameView* view) { | 131 void RemoteFrame::SetView(RemoteFrameView* view) { |
125 // Oilpan: as RemoteFrameView performs no finalization actions, | 132 // Oilpan: as RemoteFrameView performs no finalization actions, |
126 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) | 133 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) |
127 view_ = view; | 134 view_ = view; |
128 } | 135 } |
129 | 136 |
130 void RemoteFrame::CreateView() { | 137 void RemoteFrame::CreateView() { |
131 // If the RemoteFrame does not have a LocalFrame parent, there's no need to | 138 // If the RemoteFrame does not have a LocalFrame parent, there's no need to |
132 // create a widget for it. | 139 // create a widget for it. |
133 if (!DeprecatedLocalOwner()) | 140 if (!DeprecatedLocalOwner()) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 FrameVector children_to_detach; | 172 FrameVector children_to_detach; |
166 children_to_detach.ReserveCapacity(Tree().ChildCount()); | 173 children_to_detach.ReserveCapacity(Tree().ChildCount()); |
167 for (Frame* child = Tree().FirstChild(); child; | 174 for (Frame* child = Tree().FirstChild(); child; |
168 child = child->Tree().NextSibling()) | 175 child = child->Tree().NextSibling()) |
169 children_to_detach.push_back(child); | 176 children_to_detach.push_back(child); |
170 for (const auto& child : children_to_detach) | 177 for (const auto& child : children_to_detach) |
171 child->Detach(FrameDetachType::kRemove); | 178 child->Detach(FrameDetachType::kRemove); |
172 } | 179 } |
173 | 180 |
174 } // namespace blink | 181 } // namespace blink |
OLD | NEW |