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