OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 #include "core/editing/TextAffinity.h" | 111 #include "core/editing/TextAffinity.h" |
112 #include "core/editing/iterators/TextIterator.h" | 112 #include "core/editing/iterators/TextIterator.h" |
113 #include "core/editing/serializers/Serialization.h" | 113 #include "core/editing/serializers/Serialization.h" |
114 #include "core/editing/spellcheck/SpellChecker.h" | 114 #include "core/editing/spellcheck/SpellChecker.h" |
115 #include "core/fetch/ResourceFetcher.h" | 115 #include "core/fetch/ResourceFetcher.h" |
116 #include "core/fetch/SubstituteData.h" | 116 #include "core/fetch/SubstituteData.h" |
117 #include "core/frame/Console.h" | 117 #include "core/frame/Console.h" |
118 #include "core/frame/LocalDOMWindow.h" | 118 #include "core/frame/LocalDOMWindow.h" |
119 #include "core/frame/FrameHost.h" | 119 #include "core/frame/FrameHost.h" |
120 #include "core/frame/FrameView.h" | 120 #include "core/frame/FrameView.h" |
| 121 #include "core/frame/RemoteFrame.h" |
121 #include "core/frame/Settings.h" | 122 #include "core/frame/Settings.h" |
122 #include "core/frame/UseCounter.h" | 123 #include "core/frame/UseCounter.h" |
123 #include "core/html/HTMLAnchorElement.h" | 124 #include "core/html/HTMLAnchorElement.h" |
124 #include "core/html/HTMLCollection.h" | 125 #include "core/html/HTMLCollection.h" |
125 #include "core/html/HTMLFormElement.h" | 126 #include "core/html/HTMLFormElement.h" |
126 #include "core/html/HTMLFrameElementBase.h" | 127 #include "core/html/HTMLFrameElementBase.h" |
127 #include "core/html/HTMLFrameOwnerElement.h" | 128 #include "core/html/HTMLFrameOwnerElement.h" |
128 #include "core/html/HTMLHeadElement.h" | 129 #include "core/html/HTMLHeadElement.h" |
129 #include "core/html/HTMLImageElement.h" | 130 #include "core/html/HTMLImageElement.h" |
130 #include "core/html/HTMLInputElement.h" | 131 #include "core/html/HTMLInputElement.h" |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1985 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra
me, const WebString& name, WebSandboxFlags flags, const WebFrameOwnerProperties&
frameOwnerProperties) | 1986 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra
me, const WebString& name, WebSandboxFlags flags, const WebFrameOwnerProperties&
frameOwnerProperties) |
1986 { | 1987 { |
1987 Frame* oldFrame = toCoreFrame(oldWebFrame); | 1988 Frame* oldFrame = toCoreFrame(oldWebFrame); |
1988 // Note: this *always* temporarily sets a frame owner, even for main frames! | 1989 // Note: this *always* temporarily sets a frame owner, even for main frames! |
1989 // When a core Frame is created with no owner, it attempts to set itself as | 1990 // When a core Frame is created with no owner, it attempts to set itself as |
1990 // the main frame of the Page. However, this is a provisional frame, and may | 1991 // the main frame of the Page. However, this is a provisional frame, and may |
1991 // disappear, so Page::m_mainFrame can't be updated just yet. | 1992 // disappear, so Page::m_mainFrame can't be updated just yet. |
1992 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu
llptr, SandboxNone, WebFrameOwnerProperties()); | 1993 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu
llptr, SandboxNone, WebFrameOwnerProperties()); |
1993 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClien
tImpl.get(), oldFrame->host(), tempOwner.get()); | 1994 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(m_frameLoaderClien
tImpl.get(), oldFrame->host(), tempOwner.get()); |
1994 frame->setOwner(oldFrame->owner()); | 1995 frame->setOwner(oldFrame->owner()); |
1995 frame->tree().setName(name); | |
1996 setParent(oldWebFrame->parent()); | 1996 setParent(oldWebFrame->parent()); |
1997 setOpener(oldWebFrame->opener()); | 1997 setOpener(oldWebFrame->opener()); |
| 1998 |
| 1999 // Set the name and unique name directly. |
| 2000 // TODO(creis): Remove |name| and use the oldWebFrame's name. |
| 2001 frame->tree().setNameForReplacementFrame(name, toWebRemoteFrameImpl(oldWebFr
ame)->frame()->tree().uniqueName()); |
| 2002 |
1998 setCoreFrame(frame); | 2003 setCoreFrame(frame); |
1999 | 2004 |
2000 if (frame->owner() && !frame->owner()->isLocal()) { | 2005 if (frame->owner() && !frame->owner()->isLocal()) { |
2001 toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<Sa
ndboxFlags>(flags)); | 2006 toRemoteBridgeFrameOwner(frame->owner())->setSandboxFlags(static_cast<Sa
ndboxFlags>(flags)); |
2002 // Since a remote frame doesn't get the notifications about frame owner | 2007 // Since a remote frame doesn't get the notifications about frame owner |
2003 // property modifications, we need to sync up those properties here. | 2008 // property modifications, we need to sync up those properties here. |
2004 WebLocalFrameImpl::fromFrame(frame.get())->setFrameOwnerProperties(frame
OwnerProperties); | 2009 WebLocalFrameImpl::fromFrame(frame.get())->setFrameOwnerProperties(frame
OwnerProperties); |
2005 } | 2010 } |
2006 | 2011 |
2007 // We must call init() after m_frame is assigned because it is referenced | 2012 // We must call init() after m_frame is assigned because it is referenced |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 } | 2217 } |
2213 | 2218 |
2214 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const | 2219 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const |
2215 { | 2220 { |
2216 if (!frame()) | 2221 if (!frame()) |
2217 return WebSandboxFlags::None; | 2222 return WebSandboxFlags::None; |
2218 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2223 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
2219 } | 2224 } |
2220 | 2225 |
2221 } // namespace blink | 2226 } // namespace blink |
OLD | NEW |