Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: public/web/WebNode.h

Issue 19856004: Adds WebElement::imageContents() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: put it on WebNode since we retain the context menu node Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« Source/web/WebNode.cpp ('K') | « Source/web/WebNode.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebNode_h 31 #ifndef WebNode_h
32 #define WebNode_h 32 #define WebNode_h
33 33
34 #include "../platform/WebCommon.h" 34 #include "../platform/WebCommon.h"
35 #include "../platform/WebImage.h"
35 #include "../platform/WebPrivatePtr.h" 36 #include "../platform/WebPrivatePtr.h"
36 #include "../platform/WebString.h" 37 #include "../platform/WebString.h"
37 #include "WebExceptionCode.h" 38 #include "WebExceptionCode.h"
38 39
39 namespace WebCore { class Node; } 40 namespace WebCore { class Node; }
40 41
41 namespace WebKit { 42 namespace WebKit {
42 class WebDOMEvent; 43 class WebDOMEvent;
43 class WebDOMEventListener; 44 class WebDOMEventListener;
44 class WebDOMEventListenerPrivate; 45 class WebDOMEventListenerPrivate;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 WEBKIT_EXPORT bool focused() const; 117 WEBKIT_EXPORT bool focused() const;
117 WEBKIT_EXPORT bool remove(); 118 WEBKIT_EXPORT bool remove();
118 119
119 // Returns true if the node has a non-empty bounding box in layout. 120 // Returns true if the node has a non-empty bounding box in layout.
120 // This does not 100% guarantee the user can see it, but is pretty close. 121 // This does not 100% guarantee the user can see it, but is pretty close.
121 // Note: This method only works properly after layout has occurred. 122 // Note: This method only works properly after layout has occurred.
122 WEBKIT_EXPORT bool hasNonEmptyBoundingBox() const; 123 WEBKIT_EXPORT bool hasNonEmptyBoundingBox() const;
123 WEBKIT_EXPORT WebPluginContainer* pluginContainer() const; 124 WEBKIT_EXPORT WebPluginContainer* pluginContainer() const;
124 WEBKIT_EXPORT WebElement shadowHost() const; 125 WEBKIT_EXPORT WebElement shadowHost() const;
125 126
127 // Returns the image contents of this WebNode or a null WebImage
128 // if there isn't any.
129 WEBKIT_EXPORT WebImage imageContents();
130
126 template<typename T> T to() 131 template<typename T> T to()
127 { 132 {
128 T res; 133 T res;
129 res.WebNode::assign(*this); 134 res.WebNode::assign(*this);
130 return res; 135 return res;
131 } 136 }
132 137
133 template<typename T> const T toConst() const 138 template<typename T> const T toConst() const
134 { 139 {
135 T res; 140 T res;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 175 }
171 176
172 inline bool operator<(const WebNode& a, const WebNode& b) 177 inline bool operator<(const WebNode& a, const WebNode& b)
173 { 178 {
174 return a.lessThan(b); 179 return a.lessThan(b);
175 } 180 }
176 181
177 } // namespace WebKit 182 } // namespace WebKit
178 183
179 #endif 184 #endif
OLDNEW
« Source/web/WebNode.cpp ('K') | « Source/web/WebNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698