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

Unified Diff: ash/devtools/widget_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/view_element.cc ('k') | ash/devtools/widget_element.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/devtools/widget_element.h
diff --git a/ash/devtools/widget_element.h b/ash/devtools/widget_element.h
new file mode 100644
index 0000000000000000000000000000000000000000..c8715787061e5b27c45efe5f9b700e5ebf6e5b01
--- /dev/null
+++ b/ash/devtools/widget_element.h
@@ -0,0 +1,57 @@
+// 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_WIDGET_ELEMENT_H_
+#define ASH_DEVTOOLS_WIDGET_ELEMENT_H_
+
+#include "ash/ash_export.h"
+#include "ash/devtools/ui_element.h"
+#include "base/macros.h"
+#include "ui/aura/window.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_observer.h"
+#include "ui/views/widget/widget_removals_observer.h"
+
+namespace ash {
+namespace devtools {
+
+class UIElementDelegate;
+
+class ASH_EXPORT WidgetElement : public views::WidgetRemovalsObserver,
+ public views::WidgetObserver,
+ public UIElement {
+ public:
+ WidgetElement(views::Widget* widget,
+ UIElementDelegate* ui_element_delegate,
+ UIElement* parent);
+ ~WidgetElement() override;
+ views::Widget* widget() const { return widget_; };
+
+ // views::WidgetRemovalsObserver:
+ void OnWillRemoveView(views::Widget* widget, views::View* view) override;
+
+ // views::WidgetObserver:
+ void OnWidgetBoundsChanged(views::Widget* widget,
+ 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 views::Widget* From(UIElement* element);
+
+ private:
+ views::Widget* widget_;
+
+ DISALLOW_COPY_AND_ASSIGN(WidgetElement);
+};
+
+} // namespace devtools
+} // namespace ash
+
+#endif // ASH_DEVTOOLS_WIDGET_ELEMENT_H_
« no previous file with comments | « ash/devtools/view_element.cc ('k') | ash/devtools/widget_element.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698