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

Unified Diff: ash/common/devtools/ui_element.cc

Issue 2776543002: Create a unified UIElement interface for Widget, View and Window. (Closed)
Patch Set: . Created 3 years, 9 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/common/devtools/ui_element.cc
diff --git a/ash/common/devtools/ui_element.cc b/ash/common/devtools/ui_element.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a688b589af8fc6cc977035aade66b857375a62ba
--- /dev/null
+++ b/ash/common/devtools/ui_element.cc
@@ -0,0 +1,33 @@
+// 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/common/devtools/ui_element.h"
+
+namespace ash {
+namespace devtools {
+
+UIElement::UIElement() {}
+
+UIElement::~UIElement() {}
+
+UIElement* UIElement::GetInstance() {
+ DCHECK(instance_);
+ return instance_;
+}
+
+UIElement::UIElement(int node_id) {
+ node_id_ = node_id;
+}
+
+// static
+UIElement* UIElement::ConvertNodeIdToUIElement(int node_id) {
+ return GetInstance()->node_id_to_ui_element[node_id];
+}
+
+int UIElement::GetNodeId() const {
+ return node_id_;
+}
+
+} // namespace devtools
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698