summaryrefslogtreecommitdiff
path: root/chromium/components/ui_devtools/ui_element.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/ui_devtools/ui_element.h')
-rw-r--r--chromium/components/ui_devtools/ui_element.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/chromium/components/ui_devtools/ui_element.h b/chromium/components/ui_devtools/ui_element.h
index 0d26d3b6e76..541b4ffd41f 100644
--- a/chromium/components/ui_devtools/ui_element.h
+++ b/chromium/components/ui_devtools/ui_element.h
@@ -40,6 +40,13 @@ class UI_DEVTOOLS_EXPORT UIElement {
std::vector<UIProperty> properties_;
};
+ struct UI_DEVTOOLS_EXPORT Source {
+ Source(std::string path, int line);
+
+ std::string path_;
+ int line_;
+ };
+
using UIElements = std::vector<UIElement*>;
// resets node ids to 0 so that they are reusable
@@ -59,6 +66,11 @@ class UI_DEVTOOLS_EXPORT UIElement {
int GetBaseStylesheetId() const { return base_stylesheet_id_; }
void SetBaseStylesheetId(int id) { base_stylesheet_id_ = id; }
+ // Gets/sets whether the element has sent its stylesheet header to the
+ // frontend.
+ bool header_sent() const { return header_sent_; }
+ void set_header_sent() { header_sent_ = true; }
+
using ElementCompare = bool (*)(const UIElement*, const UIElement*);
// Inserts |child| in front of |before|. If |before| is null, it is inserted
@@ -118,10 +130,17 @@ class UI_DEVTOOLS_EXPORT UIElement {
// Called from PageAgent to repaint Views for Debug Bounds Rectangles
virtual void PaintRect() const {}
+ // Called in the constructor to initialize the element's sources.
+ virtual void InitSources() {}
+
+ // Get the sources for the element.
+ std::vector<Source> GetSources();
+
protected:
UIElement(const UIElementType type,
UIElementDelegate* delegate,
UIElement* parent);
+ void AddSource(std::string path, int line);
private:
const int node_id_;
@@ -132,6 +151,8 @@ class UI_DEVTOOLS_EXPORT UIElement {
bool is_updating_ = false;
bool owns_children_ = true;
int base_stylesheet_id_;
+ bool header_sent_ = false;
+ std::vector<Source> sources_;
DISALLOW_COPY_AND_ASSIGN(UIElement);
};