OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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. |
| 4 |
| 5 #ifndef HEADLESS_PUBLIC_WEB_NODE_H_ |
| 6 #define HEADLESS_PUBLIC_WEB_NODE_H_ |
| 7 |
| 8 #include "headless/public/headless_export.h" |
| 9 #include "third_party/WebKit/public/web/WebNode.h" |
| 10 |
| 11 namespace headless { |
| 12 |
| 13 class WebElement; |
| 14 class WebDocument; |
| 15 |
| 16 class HEADLESS_EXPORT WebNode { |
| 17 public: |
| 18 WebNode(const blink::WebNode&); |
| 19 |
| 20 std::string Value() const; |
| 21 |
| 22 WebNode Parent() const; |
| 23 WebNode FirstChild() const; |
| 24 WebNode LastChild() const; |
| 25 WebNode NextSibling() const; |
| 26 WebNode PreviousSibling() const; |
| 27 bool HasChildNodes() const; |
| 28 |
| 29 bool IsDocument() const; |
| 30 bool IsElement() const; |
| 31 |
| 32 WebElement AsElement() const; |
| 33 WebDocument AsDocument() const; |
| 34 |
| 35 inline bool operator==(const WebNode& other) const { |
| 36 return web_node() == other.web_node(); |
| 37 } |
| 38 inline bool operator!=(const WebNode& other) const { |
| 39 return !(*this == other); |
| 40 } |
| 41 |
| 42 protected: |
| 43 blink::WebNode& web_node(); |
| 44 const blink::WebNode& web_node() const; |
| 45 |
| 46 blink::WebNode web_node_; |
| 47 }; |
| 48 |
| 49 } // namespace headless |
| 50 |
| 51 #endif // HEADLESS_PUBLIC_WEB_NODE_H_ |
OLD | NEW |