Chromium Code Reviews| 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_ELEMENT_H_ | |
| 6 #define HEADLESS_PUBLIC_WEB_ELEMENT_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "headless/public/web_node.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 struct WebRect; | |
| 15 class WebElement; | |
| 16 } | |
| 17 | |
| 18 namespace headless { | |
| 19 | |
| 20 class WebElement : public WebNode { | |
| 21 public: | |
| 22 WebElement(const blink::WebElement& web_element); | |
| 23 WebElement(const WebElement& web_element); | |
| 24 ~WebElement(); | |
| 25 | |
| 26 std::string TagName() const; | |
| 27 // 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.
| |
| 28 blink::WebRect BoundingBox() const; | |
| 29 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
| |
| 30 | |
| 31 protected: | |
| 32 blink::WebElement& web_element(); | |
| 33 const blink::WebElement& web_element() const; | |
| 34 | |
| 35 private: | |
| 36 mutable scoped_ptr<std::map<std::string, std::string>> attributes_; | |
| 37 }; | |
| 38 | |
| 39 } // namespace headless | |
| 40 | |
| 41 #endif // HEADLESS_PUBLIC_WEB_ELEMENT_H_ | |
| OLD | NEW |