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

Unified Diff: ash/common/devtools/ui_element_delegate.h

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_delegate.h
diff --git a/ash/common/devtools/ui_element_delegate.h b/ash/common/devtools/ui_element_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..dae189106fef569bf7d33bc9ee1641675b95c2ad
--- /dev/null
+++ b/ash/common/devtools/ui_element_delegate.h
@@ -0,0 +1,54 @@
+// 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.
+
+#ifndef ASH_COMMON_DEVTOOLS_UI_ELEMENT_DELEGATE_H_
+#define ASH_COMMON_DEVTOOLS_UI_ELEMENT_DELEGATE_H_
+
+#include "ash/ash_export.h"
+#include "ash/common/devtools/ash_devtools_dom_agent.h"
+#include "ash/common/wm_window.h"
+#include "ui/aura/window_observer.h"
+#include "ui/views/view.h"
+#include "ui/views/widget/widget.h"
+
+namespace ash {
+namespace devtools {
+
+class ASH_EXPORT UIElementDelegate {
+ public:
+ // For WindowElement
+ void NotifyOnWindowHierarchyChanging(
+ const aura::WindowObserver::HierarchyChangeParams& params);
+ void NotifyOnWindowHierarchyChanged(
+ const aura::WindowObserver::HierarchyChangeParams& params);
+ void NotifyRemoveWindowTree(WmWindow* window, bool remove_observer);
+ void NotifyAddWindowTree(WmWindow* window);
+ void NotfiyOnWindowBoundsChanged(WmWindow* window);
+
+ // For ViewElement
+ void NotifyRemoveViewTree(views::View* view,
+ views::View* parent,
+ bool remove_observer);
+ void NotifyAddViewTree(views::View* view);
+ void NotifyOnViewBoundsChanged(views::View* view);
+
+ // For WidgetElement
+ void NotifyOnWidgetBoundsChanged(views::Widget* widget);
+
+ void SetDelegate(AshDevToolsDOMAgent* dom_agent) {
+ dom_agent_delegate = dom_agent;
+ };
+
+ AshDevToolsDOMAgent* DomAgentDelegate() { return dom_agent_delegate; }
+
+ private:
+ AshDevToolsDOMAgent* dom_agent_delegate;
+
+ DISALLOW_COPY_AND_ASSIGN(UIElementDelegate);
+};
+
+} // namespace devtools
+} // namespace ash
+
+#endif // ASH_COMMON_DEVTOOLS_UI_ELEMENT_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698