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

Unified Diff: headless/public/web_node.h

Issue 1461693003: [headless] Initial skeleton of headless/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pure virtual indeed Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« headless/public/web_frame.h ('K') | « headless/public/web_frame.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/web_node.h
diff --git a/headless/public/web_node.h b/headless/public/web_node.h
new file mode 100644
index 0000000000000000000000000000000000000000..c1a4880e2e31216ee99f2de3dd7debb82998cc56
--- /dev/null
+++ b/headless/public/web_node.h
@@ -0,0 +1,51 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef HEADLESS_PUBLIC_WEB_NODE_H_
+#define HEADLESS_PUBLIC_WEB_NODE_H_
+
+#include "headless/public/headless_export.h"
+#include "third_party/WebKit/public/web/WebNode.h"
+
+namespace headless {
+
+class WebElement;
+class WebDocument;
+
+class HEADLESS_EXPORT WebNode {
+ public:
+ WebNode(const blink::WebNode&);
+
+ std::string Value() const;
+
+ WebNode Parent() const;
+ WebNode FirstChild() const;
+ WebNode LastChild() const;
+ WebNode NextSibling() const;
+ WebNode PreviousSibling() const;
+ bool HasChildNodes() const;
+
+ bool IsDocument() const;
+ bool IsElement() const;
+
+ WebElement AsElement() const;
+ WebDocument AsDocument() const;
+
+ inline bool operator==(const WebNode& other) const {
+ return web_node() == other.web_node();
+ }
+ inline bool operator!=(const WebNode& other) const {
+ return !(*this == other);
+ }
+
+ protected:
+ blink::WebNode& web_node();
+ const blink::WebNode& web_node() const;
+
+ blink::WebNode web_node_;
+};
+
+} // namespace headless
+
+#endif // HEADLESS_PUBLIC_WEB_NODE_H_
« headless/public/web_frame.h ('K') | « headless/public/web_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698