| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_DEVTOOLS_UI_ELEMENT_H_ | 5 #ifndef COMPONENTS_UI_DEVTOOLS_VIEWS_UI_ELEMENT_H_ |
| 6 #define ASH_DEVTOOLS_UI_ELEMENT_H_ | 6 #define COMPONENTS_UI_DEVTOOLS_VIEWS_UI_ELEMENT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | |
| 11 #include "base/macros.h" | 10 #include "base/macros.h" |
| 12 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
| 13 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
| 14 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
| 15 | 14 |
| 16 namespace ash { | 15 namespace ui_devtools { |
| 17 namespace devtools { | |
| 18 | 16 |
| 19 class UIElementDelegate; | 17 class UIElementDelegate; |
| 20 | 18 |
| 21 // UIElement type. | 19 // UIElement type. |
| 22 enum UIElementType { WINDOW, WIDGET, VIEW }; | 20 enum UIElementType { WINDOW, WIDGET, VIEW }; |
| 23 | 21 |
| 24 class ASH_EXPORT UIElement { | 22 class UIElement { |
| 25 public: | 23 public: |
| 26 virtual ~UIElement(); | 24 virtual ~UIElement(); |
| 27 int node_id() const { return node_id_; }; | 25 int node_id() const { return node_id_; }; |
| 28 std::string GetTypeName() const; | 26 std::string GetTypeName() const; |
| 29 UIElement* parent() const { return parent_; }; | 27 UIElement* parent() const { return parent_; }; |
| 30 UIElementDelegate* delegate() const { return delegate_; }; | 28 UIElementDelegate* delegate() const { return delegate_; }; |
| 31 UIElementType type() const { return type_; }; | 29 UIElementType type() const { return type_; }; |
| 32 const std::vector<UIElement*>& children() const { return children_; }; | 30 const std::vector<UIElement*>& children() const { return children_; }; |
| 33 | 31 |
| 34 // |child| is inserted in front of |before|. If |before| is null, it | 32 // |child| is inserted in front of |before|. If |before| is null, it |
| (...skipping 30 matching lines...) Expand all Loading... |
| 65 private: | 63 private: |
| 66 const int node_id_; | 64 const int node_id_; |
| 67 const UIElementType type_; | 65 const UIElementType type_; |
| 68 std::vector<UIElement*> children_; | 66 std::vector<UIElement*> children_; |
| 69 UIElement* parent_; | 67 UIElement* parent_; |
| 70 UIElementDelegate* delegate_; | 68 UIElementDelegate* delegate_; |
| 71 | 69 |
| 72 DISALLOW_COPY_AND_ASSIGN(UIElement); | 70 DISALLOW_COPY_AND_ASSIGN(UIElement); |
| 73 }; | 71 }; |
| 74 | 72 |
| 75 } // namespace devtools | 73 } // namespace ui_devtools |
| 76 } // namespace ash | |
| 77 | 74 |
| 78 #endif // ASH_DEVTOOLS_UI_ELEMENT_H_ | 75 #endif // COMPONENTS_UI_DEVTOOLS_VIEWS_UI_ELEMENT_H_ |
| OLD | NEW |