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. Delete this WebFrame by calling WebFrame::close(). |
| 97 // It is valid to pass a null client pointer. |
| 98 BLINK_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 // generateEmbedderIdentifier() if constructing the WebFrameClient for this |
| 103 // frame requires the identifier. |
| 104 // |
| 105 // FIXME: Move the embedderIdentifier concept fully to the embedder and |
| 106 // remove this factory method. |
| 107 BLINK_EXPORT static WebFrame* create(WebFrameClient*, long long embedderIden
tifier); |
| 108 |
| 109 // Generates an identifier suitable for use with create() above. |
| 110 // Never returns -1. |
| 111 BLINK_EXPORT static long long generateEmbedderIdentifier(); |
| 112 |
95 // Returns the number of live WebFrame objects, used for leak checking. | 113 // Returns the number of live WebFrame objects, used for leak checking. |
96 BLINK_EXPORT static int instanceCount(); | 114 BLINK_EXPORT static int instanceCount(); |
97 | 115 |
98 // Returns the WebFrame associated with the current V8 context. This | 116 // Returns the WebFrame associated with the current V8 context. This |
99 // function can return 0 if the context is associated with a Document that | 117 // function can return 0 if the context is associated with a Document that |
100 // is not currently being displayed in a Frame. | 118 // is not currently being displayed in a Frame. |
101 BLINK_EXPORT static WebFrame* frameForCurrentContext(); | 119 BLINK_EXPORT static WebFrame* frameForCurrentContext(); |
102 | 120 |
103 // Returns the frame corresponding to the given context. This can return 0 | 121 // 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 | 122 // if the context is detached from the frame, or if the context doesn't |
105 // correspond to a frame (e.g., workers). | 123 // correspond to a frame (e.g., workers). |
106 BLINK_EXPORT static WebFrame* frameForContext(v8::Handle<v8::Context>); | 124 BLINK_EXPORT static WebFrame* frameForContext(v8::Handle<v8::Context>); |
107 | 125 |
108 // Returns the frame inside a given frame or iframe element. Returns 0 if | 126 // 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. | 127 // the given element is not a frame, iframe or if the frame is empty. |
110 BLINK_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&); | 128 BLINK_EXPORT static WebFrame* fromFrameOwnerElement(const WebElement&); |
111 | 129 |
| 130 // This method closes and deletes the WebFrame. |
| 131 virtual void close() = 0; |
| 132 |
112 | 133 |
113 // Basic properties --------------------------------------------------- | 134 // Basic properties --------------------------------------------------- |
114 | 135 |
115 // The unique name of this frame. | 136 // The unique name of this frame. |
116 virtual WebString uniqueName() const = 0; | 137 virtual WebString uniqueName() const = 0; |
117 | 138 |
118 // The name of this frame. If no name is given, empty string is returned. | 139 // The name of this frame. If no name is given, empty string is returned. |
119 virtual WebString assignedName() const = 0; | 140 virtual WebString assignedName() const = 0; |
120 | 141 |
121 // Sets the name of this frame. For child frames (frames that are not a | 142 // 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 | 143 // top-most frame) the actual name may have a suffix appended to make the |
123 // frame name unique within the hierarchy. | 144 // frame name unique within the hierarchy. |
124 virtual void setName(const WebString&) = 0; | 145 virtual void setName(const WebString&) = 0; |
125 | 146 |
126 // A globally unique identifier for this frame. | 147 // A globally unique identifier for this frame. |
127 virtual long long identifier() const = 0; | 148 // FIXME: Convert users to embedderIdentifier() and remove identifier(). |
| 149 long long identifier() const { return embedderIdentifier(); } |
| 150 virtual long long embedderIdentifier() const = 0; |
128 | 151 |
129 // The urls of the given combination types of favicon (if any) specified by | 152 // The urls of the given combination types of favicon (if any) specified by |
130 // the document loaded in this frame. The iconTypesMask is a bit-mask of | 153 // the document loaded in this frame. The iconTypesMask is a bit-mask of |
131 // WebIconURL::Type values, used to select from the available set of icon | 154 // WebIconURL::Type values, used to select from the available set of icon |
132 // URLs | 155 // URLs |
133 virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const = 0; | 156 virtual WebVector<WebIconURL> iconURLs(int iconTypesMask) const = 0; |
134 | 157 |
135 | 158 |
136 // Geometry ----------------------------------------------------------- | 159 // Geometry ----------------------------------------------------------- |
137 | 160 |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 // text form. This is used only by layout tests. | 669 // text form. This is used only by layout tests. |
647 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; | 670 virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; |
648 | 671 |
649 protected: | 672 protected: |
650 ~WebFrame() { } | 673 ~WebFrame() { } |
651 }; | 674 }; |
652 | 675 |
653 } // namespace WebKit | 676 } // namespace WebKit |
654 | 677 |
655 #endif | 678 #endif |
OLD | NEW |