Index: headless/public/web_element.h |
diff --git a/headless/public/web_element.h b/headless/public/web_element.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2c0131500e0211d7238bd36535342efe6012667c |
--- /dev/null |
+++ b/headless/public/web_element.h |
@@ -0,0 +1,41 @@ |
+// 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_ELEMENT_H_ |
+#define HEADLESS_PUBLIC_WEB_ELEMENT_H_ |
+ |
+#include <map> |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "headless/public/web_node.h" |
+ |
+namespace blink { |
+struct WebRect; |
+class WebElement; |
+} |
+ |
+namespace headless { |
+ |
+class WebElement : public WebNode { |
+ public: |
+ WebElement(const blink::WebElement& web_element); |
+ WebElement(const WebElement& web_element); |
+ ~WebElement(); |
+ |
+ std::string TagName() const; |
+ // TODO(altimin): replace with headless::WebRect. |
Sami
2015/11/19 14:08:35
This could also be a gfx::Rect.
altimin
2015/11/19 14:52:54
Done.
|
+ blink::WebRect BoundingBox() const; |
+ const std::map<std::string, std::string>& Attributes() const; |
Sami
2015/11/19 14:08:34
We'll probably want to turn this into an iterator
altimin
2015/11/19 14:52:54
But we also want to access individual attributes:
Sami
2015/11/19 15:42:44
Right, the problem is that making this a map requi
|
+ |
+ protected: |
+ blink::WebElement& web_element(); |
+ const blink::WebElement& web_element() const; |
+ |
+ private: |
+ mutable scoped_ptr<std::map<std::string, std::string>> attributes_; |
+}; |
+ |
+} // namespace headless |
+ |
+#endif // HEADLESS_PUBLIC_WEB_ELEMENT_H_ |