| 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_DEVTOOLS_UI_ELEMENT_H_ |
| 6 #define ASH_DEVTOOLS_UI_ELEMENT_H_ | 6 #define COMPONENTS_UI_DEVTOOLS_DEVTOOLS_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 { |
| 17 namespace devtools { | 16 namespace devtools { |
| 18 | 17 |
| 19 class UIElementDelegate; | 18 class UIElementDelegate; |
| 20 | 19 |
| 21 // UIElement type. | 20 // UIElement type. |
| 22 enum UIElementType { WINDOW, WIDGET, VIEW }; | 21 enum UIElementType { WINDOW, WIDGET, VIEW }; |
| 23 | 22 |
| 24 class ASH_EXPORT UIElement { | 23 class UIElement { |
| 25 public: | 24 public: |
| 26 int node_id() const { return node_id_; }; | 25 int node_id() const { return node_id_; }; |
| 27 std::string GetTypeName() const; | 26 std::string GetTypeName() const; |
| 28 UIElement* parent() const { return parent_; }; | 27 UIElement* parent() const { return parent_; }; |
| 29 UIElementDelegate* delegate() const { return delegate_; }; | 28 UIElementDelegate* delegate() const { return delegate_; }; |
| 30 UIElementType type() const { return type_; }; | 29 UIElementType type() const { return type_; }; |
| 31 const std::vector<UIElement*>& children() const { return children_; }; | 30 const std::vector<UIElement*>& children() const { return children_; }; |
| 32 | 31 |
| 33 // |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 |
| 34 // is inserted at the end. | 33 // is inserted at the end. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 const int node_id_; | 65 const int node_id_; |
| 67 const UIElementType type_; | 66 const UIElementType type_; |
| 68 std::vector<UIElement*> children_; | 67 std::vector<UIElement*> children_; |
| 69 UIElement* parent_; | 68 UIElement* parent_; |
| 70 UIElementDelegate* delegate_; | 69 UIElementDelegate* delegate_; |
| 71 | 70 |
| 72 DISALLOW_COPY_AND_ASSIGN(UIElement); | 71 DISALLOW_COPY_AND_ASSIGN(UIElement); |
| 73 }; | 72 }; |
| 74 | 73 |
| 75 } // namespace devtools | 74 } // namespace devtools |
| 76 } // namespace ash | 75 } // namespace ui |
| 77 | 76 |
| 78 #endif // ASH_DEVTOOLS_UI_ELEMENT_H_ | 77 #endif // COMPONENTS_UI_DEVTOOLS_DEVTOOLS_UI_ELEMENT_H_ |
| OLD | NEW |