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

Unified Diff: ash/devtools/window_element.h

Issue 2776543002: Create a unified UIElement interface for Widget, View and Window. (Closed)
Patch Set: . Created 3 years, 7 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
« no previous file with comments | « ash/devtools/widget_element.cc ('k') | ash/devtools/window_element.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/devtools/window_element.h
diff --git a/ash/devtools/window_element.h b/ash/devtools/window_element.h
new file mode 100644
index 0000000000000000000000000000000000000000..2f4996f4f9cd9568b6d03a664e0df0490a9b8a1b
--- /dev/null
+++ b/ash/devtools/window_element.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_DEVTOOLS_WINDOW_ELEMENT_H_
+#define ASH_DEVTOOLS_WINDOW_ELEMENT_H_
+
+#include "ash/ash_export.h"
+#include "ash/devtools/ui_element.h"
+#include "base/macros.h"
+#include "ui/aura/window.h"
+#include "ui/aura/window_observer.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace ash {
+namespace devtools {
+
+class ASH_EXPORT WindowElement : public aura::WindowObserver, public UIElement {
+ public:
+ WindowElement(aura::Window* window,
+ UIElementDelegate* ui_element_delegate,
+ UIElement* parent);
+ ~WindowElement() override;
+ aura::Window* window() const { return window_; };
+
+ // WindowObserver:
+ void OnWindowHierarchyChanging(
+ const aura::WindowObserver::HierarchyChangeParams& params) override;
+ void OnWindowHierarchyChanged(
+ const aura::WindowObserver::HierarchyChangeParams& params) override;
+ void OnWindowStackingChanged(aura::Window* window) override;
+ void OnWindowBoundsChanged(aura::Window* window,
+ const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) override;
+
+ // UIElement:
+ void GetBounds(gfx::Rect* bounds) const override;
+ void SetBounds(const gfx::Rect& bounds) override;
+ void GetVisible(bool* visible) const override;
+ void SetVisible(bool visible) override;
+ std::pair<aura::Window*, gfx::Rect> GetNodeWindowAndBounds() const override;
+
+ static aura::Window* From(UIElement* element);
+
+ private:
+ aura::Window* window_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowElement);
+};
+
+} // namespace devtools
+} // namespace ash
+
+#endif // ASH_DEVTOOLS_WINDOW_ELEMENT_H_
« no previous file with comments | « ash/devtools/widget_element.cc ('k') | ash/devtools/window_element.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698