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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: ash/devtools/ui_element.cc
diff --git a/ash/devtools/ui_element.cc b/ash/devtools/ui_element.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d0b8c3346f7f807703e4b1d5b45cf29c2fbac88f
--- /dev/null
+++ b/ash/devtools/ui_element.cc
@@ -0,0 +1,59 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/devtools/ui_element.h"
+#include "ash/devtools/ui_element_delegate.h"
+#include "ash/devtools/view_element.h"
+#include "ash/devtools/widget_element.h"
+#include "ash/devtools/window_element.h"
+
+namespace ash {
+namespace devtools {
+
+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
+
+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
+
+int UIElement::GetNodeId() const {
+ return node_id_;
+}
+
+void UIElement::SetNodeId(int node_id) {
+ this->node_id_ = node_id;
+}
+
+UIElement* UIElement::GetParent() {
+ return parent_;
+}
+
+void UIElement::SetParent(UIElement* parent) {
+ parent_ = parent;
+}
+
+UIElementDelegate* UIElement::GetUIElementDelegate() {
+ return ui_element_delegate_;
+}
+
+void UIElement::SetUIElementDelegate(UIElementDelegate* ui_element_delegate) {
+ this->ui_element_delegate_ = ui_element_delegate;
+}
+
+UIElementType UIElement::GetType() const {
+ return type_;
+}
+
+void UIElement::SetType(UIElementType type) {
+ type_ = type;
+}
+
+std::vector<UIElement*>& UIElement::GetChildren() {
+ return children_;
+}
+
+void UIElement::SetChildren(std::vector<UIElement*>& children) {
+ children_ = children;
+}
+
+} // namespace devtools
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698