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
3 // found in the LICENSE file.
5 #ifndef WebLocalFrame_h
6 #define WebLocalFrame_h
12 // Interface for interacting with in process frames. This contains methods that
13 // require interacting with a frame's document.
14 // FIXME: Move lots of methods from WebFrame in here.
15 class WebLocalFrame : public WebFrame {
17 // Creates a WebFrame. Delete this WebFrame by calling WebFrame::close().
18 // It is valid to pass a null client pointer.
19 BLINK_EXPORT static WebLocalFrame* create(WebFrameClient*);
21 // Returns the WebFrame associated with the current V8 context. This
22 // function can return 0 if the context is associated with a Document that
23 // is not currently being displayed in a Frame.
24 BLINK_EXPORT static WebLocalFrame* frameForCurrentContext();
26 // Returns the frame corresponding to the given context. This can return 0
27 // if the context is detached from the frame, or if the context doesn't
28 // correspond to a frame (e.g., workers).
29 BLINK_EXPORT static WebLocalFrame* frameForContext(v8::Handle<v8::Context>);
31 // Returns the frame inside a given frame or iframe element. Returns 0 if
32 // the given element is not a frame, iframe or if the frame is empty.
33 BLINK_EXPORT static WebLocalFrame* fromFrameOwnerElement(const WebElement&);
35 // Navigation Transitions ---------------------------------------------
36 virtual void addStyleSheetByURL(const WebString& url) = 0;
37 virtual void navigateToSandboxedMarkup(const WebData& markup) = 0;
39 virtual void sendPings(const WebNode& linkNode, const WebURL& destinationURL) = 0;
44 #endif // WebLocalFrame_h