Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1089)

Side by Side Diff: ash/devtools/ui_element.cc

Issue 2776543002: Create a unified UIElement interface for Widget, View and Window. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/devtools/ui_element.h"
6 #include "ash/devtools/ui_element_delegate.h"
7 #include "ash/devtools/view_element.h"
8 #include "ash/devtools/widget_element.h"
9 #include "ash/devtools/window_element.h"
10
11 namespace ash {
12 namespace devtools {
13
14 UIElement::UIElement() {}
sadrul 2017/04/19 18:21:39 When a new UIElement is created, can this generate
thanhph 2017/04/24 15:56:50 No it can't at the moment but this can be addresse
15
16 UIElement::~UIElement() {}
sadrul 2017/04/19 18:21:39 Should this destroy all its children too during de
thanhph 2017/04/24 15:56:50 I'm able to move RemoveChild() to UIElement.cc but
thanhph 2017/04/24 16:51:28 Im able to get the destructor to work now. Please
17
18 int UIElement::GetNodeId() const {
19 return node_id_;
20 }
21
22 void UIElement::SetNodeId(int node_id) {
23 this->node_id_ = node_id;
24 }
25
26 UIElement* UIElement::GetParent() {
27 return parent_;
28 }
29
30 void UIElement::SetParent(UIElement* parent) {
31 parent_ = parent;
32 }
33
34 UIElementDelegate* UIElement::GetUIElementDelegate() {
35 return ui_element_delegate_;
36 }
37
38 void UIElement::SetUIElementDelegate(UIElementDelegate* ui_element_delegate) {
39 this->ui_element_delegate_ = ui_element_delegate;
40 }
41
42 UIElementType UIElement::GetType() const {
43 return type_;
44 }
45
46 void UIElement::SetType(UIElementType type) {
47 type_ = type;
48 }
49
50 std::vector<UIElement*>& UIElement::GetChildren() {
51 return children_;
52 }
53
54 void UIElement::SetChildren(std::vector<UIElement*>& children) {
55 children_ = children;
56 }
57
58 } // namespace devtools
59 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698