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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 template <class T> class Local; | 52 template <class T> class Local; |
53 } | 53 } |
54 | 54 |
55 namespace WebKit { | 55 namespace WebKit { |
56 | 56 |
57 class WebData; | 57 class WebData; |
58 class WebDataSource; | 58 class WebDataSource; |
59 class WebDocument; | 59 class WebDocument; |
60 class WebElement; | 60 class WebElement; |
61 class WebFormElement; | 61 class WebFormElement; |
62 class WebFrameClient; | |
62 class WebHistoryItem; | 63 class WebHistoryItem; |
63 class WebInputElement; | 64 class WebInputElement; |
64 class WebPerformance; | 65 class WebPerformance; |
65 class WebRange; | 66 class WebRange; |
66 class WebSecurityOrigin; | 67 class WebSecurityOrigin; |
67 class WebString; | 68 class WebString; |
68 class WebURL; | 69 class WebURL; |
69 class WebURLLoader; | 70 class WebURLLoader; |
70 class WebURLRequest; | 71 class WebURLRequest; |
71 class WebView; | 72 class WebView; |
(...skipping 13 matching lines...) Expand all Loading... | |
85 class WebFrame { | 86 class WebFrame { |
86 public: | 87 public: |
87 // Control of renderTreeAsText output | 88 // Control of renderTreeAsText output |
88 enum RenderAsTextControl { | 89 enum RenderAsTextControl { |
89 RenderAsTextNormal = 0, | 90 RenderAsTextNormal = 0, |
90 RenderAsTextDebug = 1 << 0, | 91 RenderAsTextDebug = 1 << 0, |
91 RenderAsTextPrinting = 1 << 1 | 92 RenderAsTextPrinting = 1 << 1 |
92 }; | 93 }; |
93 typedef unsigned RenderAsTextControls; | 94 typedef unsigned RenderAsTextControls; |
94 | 95 |
96 // Creates a WebFrame with a self references. Call close() to release | |
97 // this reference. It is valid to pass null client pointers. | |
98 WEBKIT_EXPORT static WebFrame* create(WebFrameClient*); | |
99 | |
100 // Same as create(WebFrameClient*) except the embedder may explicitly pass | |
101 // in the identifier for the WebFrame. This can be used with | |
102 // generateFrameIdentifier() if constructing the WebFrameClient for this | |
103 // frame requires the identifier. | |
104 WEBKIT_EXPORT static WebFrame* create(WebFrameClient*, | |
105 long long identifier); | |
106 | |
107 // Generates an identifier suitable for use with create() above. | |
108 // Never returns -1. | |
109 WEBKIT_EXPORT static long long generateFrameIdentifier(); | |
110 | |
95 // Returns the number of live WebFrame objects, used for leak checking. | 111 // Returns the number of live WebFrame objects, used for leak checking. |
96 WEBKIT_EXPORT static int instanceCount(); | 112 WEBKIT_EXPORT static int instanceCount(); |
97 | 113 |
98 // Returns the WebFrame associated with the current V8 context. This | 114 // Returns the WebFrame associated with the current V8 context. This |
99 // function can return 0 if the context is associated with a Document that | 115 // function can return 0 if the context is associated with a Document that |
100 // is not currently being displayed in a Frame. | 116 // is not currently being displayed in a Frame. |
101 WEBKIT_EXPORT static WebFrame* frameForCurrentContext(); | 117 WEBKIT_EXPORT static WebFrame* frameForCurrentContext(); |
102 | 118 |
103 // Returns the frame corresponding to the given context. This can return 0 | 119 // Returns the frame corresponding to the given context. This can return 0 |
104 // if the context is detached from the frame, or if the context doesn't | 120 // if the context is detached from the frame, or if the context doesn't |
105 // correspond to a frame (e.g., workers). | 121 // correspond to a frame (e.g., workers). |
106 WEBKIT_EXPORT static WebFrame* frameForContext(v8::Handle<v8::Context>); | 122 WEBKIT_EXPORT static WebFrame* frameForContext(v8::Handle<v8::Context>); |
107 | 123 |
108 // Returns the frame inside a given frame or iframe element. Returns 0 if | 124 // Returns the frame inside a given frame or iframe element. Returns 0 if |
109 // the given element is not a frame, iframe or if the frame is empty. | 125 // the given element is not a frame, iframe or if the frame is empty. |
110 WEBKIT_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&); | 126 WEBKIT_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&); |
111 | 127 |
112 | 128 |
129 // This method closes and deletes the WebFrame. | |
130 virtual void close() = 0; | |
darin (slow to review)
2013/09/13 04:02:47
nit: two new lines below, one new line above.
| |
131 | |
113 // Basic properties --------------------------------------------------- | 132 // Basic properties --------------------------------------------------- |
114 | 133 |
115 // The unique name of this frame. | 134 // The unique name of this frame. |
116 virtual WebString uniqueName() const = 0; | 135 virtual WebString uniqueName() const = 0; |
117 | 136 |
118 // The name of this frame. If no name is given, empty string is returned. | 137 // The name of this frame. If no name is given, empty string is returned. |
119 virtual WebString assignedName() const = 0; | 138 virtual WebString assignedName() const = 0; |
120 | 139 |
121 // Sets the name of this frame. For child frames (frames that are not a | 140 // Sets the name of this frame. For child frames (frames that are not a |
122 // top-most frame) the actual name may have a suffix appended to make the | 141 // top-most frame) the actual name may have a suffix appended to make the |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
650 // text form. This is used only by layout tests. | 669 // text form. This is used only by layout tests. |
651 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; | 670 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; |
652 | 671 |
653 protected: | 672 protected: |
654 ~WebFrame() { } | 673 ~WebFrame() { } |
655 }; | 674 }; |
656 | 675 |
657 } // namespace WebKit | 676 } // namespace WebKit |
658 | 677 |
659 #endif | 678 #endif |
OLD | NEW |