| 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 #ifndef WebLocalFrame_h | 5 #ifndef WebLocalFrame_h |
| 6 #define WebLocalFrame_h | 6 #define WebLocalFrame_h |
| 7 | 7 |
| 8 #include "WebFrame.h" | 8 #include "WebFrame.h" |
| 9 #include "WebFrameLoadType.h" | 9 #include "WebFrameLoadType.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public: | 31 public: |
| 32 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). | 32 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close(). |
| 33 // It is valid to pass a null client pointer. | 33 // It is valid to pass a null client pointer. |
| 34 BLINK_EXPORT static WebLocalFrame* create(WebTreeScopeType, WebFrameClient*,
WebFrame* opener = nullptr); | 34 BLINK_EXPORT static WebLocalFrame* create(WebTreeScopeType, WebFrameClient*,
WebFrame* opener = nullptr); |
| 35 | 35 |
| 36 // Used to create a provisional local frame in prepration for replacing a | 36 // Used to create a provisional local frame in prepration for replacing a |
| 37 // remote frame if the load commits. The returned frame is only partially | 37 // remote frame if the load commits. The returned frame is only partially |
| 38 // attached to the frame tree: it has the same parent as its potential | 38 // attached to the frame tree: it has the same parent as its potential |
| 39 // replacee but is invisible to the rest of the frames in the frame tree. | 39 // replacee but is invisible to the rest of the frames in the frame tree. |
| 40 // If the load commits, call swap() to fully attach this frame. | 40 // If the load commits, call swap() to fully attach this frame. |
| 41 BLINK_EXPORT static WebLocalFrame* createProvisional(WebFrameClient*, WebRem
oteFrame*, WebSandboxFlags, const WebFrameOwnerProperties&); | 41 BLINK_EXPORT static WebLocalFrame* createProvisional(WebFrameClient*, WebRem
oteFrame*, WebSandboxFlags); |
| 42 | 42 |
| 43 // Returns the WebFrame associated with the current V8 context. This | 43 // Returns the WebFrame associated with the current V8 context. This |
| 44 // function can return 0 if the context is associated with a Document that | 44 // function can return 0 if the context is associated with a Document that |
| 45 // is not currently being displayed in a Frame. | 45 // is not currently being displayed in a Frame. |
| 46 BLINK_EXPORT static WebLocalFrame* frameForCurrentContext(); | 46 BLINK_EXPORT static WebLocalFrame* frameForCurrentContext(); |
| 47 | 47 |
| 48 // Returns the frame corresponding to the given context. This can return 0 | 48 // Returns the frame corresponding to the given context. This can return 0 |
| 49 // if the context is detached from the frame, or if the context doesn't | 49 // if the context is detached from the frame, or if the context doesn't |
| 50 // correspond to a frame (e.g., workers). | 50 // correspond to a frame (e.g., workers). |
| 51 BLINK_EXPORT static WebLocalFrame* frameForContext(v8::Local<v8::Context>); | 51 BLINK_EXPORT static WebLocalFrame* frameForContext(v8::Local<v8::Context>); |
| 52 | 52 |
| 53 // Returns the frame inside a given frame or iframe element. Returns 0 if | 53 // Returns the frame inside a given frame or iframe element. Returns 0 if |
| 54 // the given element is not a frame, iframe or if the frame is empty. | 54 // the given element is not a frame, iframe or if the frame is empty. |
| 55 BLINK_EXPORT static WebLocalFrame* fromFrameOwnerElement(const WebElement&); | 55 BLINK_EXPORT static WebLocalFrame* fromFrameOwnerElement(const WebElement&); |
| 56 | 56 |
| 57 // Initialization --------------------------------------------------------- | 57 // Initialization --------------------------------------------------------- |
| 58 | 58 |
| 59 virtual void setAutofillClient(WebAutofillClient*) = 0; | 59 virtual void setAutofillClient(WebAutofillClient*) = 0; |
| 60 virtual WebAutofillClient* autofillClient() = 0; | 60 virtual WebAutofillClient* autofillClient() = 0; |
| 61 virtual void setDevToolsAgentClient(WebDevToolsAgentClient*) = 0; | 61 virtual void setDevToolsAgentClient(WebDevToolsAgentClient*) = 0; |
| 62 virtual WebDevToolsAgent* devToolsAgent() = 0; | 62 virtual WebDevToolsAgent* devToolsAgent() = 0; |
| 63 | 63 |
| 64 // Basic properties --------------------------------------------------- | |
| 65 | |
| 66 // Updates the scrolling and margin properties in the frame's FrameOwner. | |
| 67 // This is used when this frame's parent is in another process and it | |
| 68 // dynamically updates these properties. | |
| 69 // TODO(dcheng): Currently, the update only takes effect on next frame | |
| 70 // navigation. This matches the in-process frame behavior. | |
| 71 virtual void setFrameOwnerProperties(const WebFrameOwnerProperties&) = 0; | |
| 72 | |
| 73 // Hierarchy ---------------------------------------------------------- | 64 // Hierarchy ---------------------------------------------------------- |
| 74 | 65 |
| 75 // Get the highest-level LocalFrame in this frame's in-process subtree. | 66 // Get the highest-level LocalFrame in this frame's in-process subtree. |
| 76 virtual WebLocalFrame* localRoot() = 0; | 67 virtual WebLocalFrame* localRoot() = 0; |
| 77 | 68 |
| 78 // Returns the previous/next local frame in "frame traversal order", | 69 // Returns the previous/next local frame in "frame traversal order", |
| 79 // optionally wrapping around. | 70 // optionally wrapping around. |
| 80 virtual WebLocalFrame* traversePreviousLocal(bool wrap) const = 0; | 71 virtual WebLocalFrame* traversePreviousLocal(bool wrap) const = 0; |
| 81 virtual WebLocalFrame* traverseNextLocal(bool wrap) const = 0; | 72 virtual WebLocalFrame* traverseNextLocal(bool wrap) const = 0; |
| 82 | 73 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 // to call these on a WebLocalFrame. | 319 // to call these on a WebLocalFrame. |
| 329 bool isWebLocalFrame() const override = 0; | 320 bool isWebLocalFrame() const override = 0; |
| 330 WebLocalFrame* toWebLocalFrame() override = 0; | 321 WebLocalFrame* toWebLocalFrame() override = 0; |
| 331 bool isWebRemoteFrame() const override = 0; | 322 bool isWebRemoteFrame() const override = 0; |
| 332 WebRemoteFrame* toWebRemoteFrame() override = 0; | 323 WebRemoteFrame* toWebRemoteFrame() override = 0; |
| 333 }; | 324 }; |
| 334 | 325 |
| 335 } // namespace blink | 326 } // namespace blink |
| 336 | 327 |
| 337 #endif // WebLocalFrame_h | 328 #endif // WebLocalFrame_h |
| OLD | NEW |