| OLD | NEW |
| (Empty) |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_DEVTOOLS_WIDGET_ELEMENT_H_ | |
| 6 #define ASH_DEVTOOLS_WIDGET_ELEMENT_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 #include "ash/devtools/ui_element.h" | |
| 10 #include "base/macros.h" | |
| 11 #include "ui/aura/window.h" | |
| 12 #include "ui/gfx/geometry/rect.h" | |
| 13 #include "ui/views/widget/widget.h" | |
| 14 #include "ui/views/widget/widget_observer.h" | |
| 15 #include "ui/views/widget/widget_removals_observer.h" | |
| 16 | |
| 17 namespace ash { | |
| 18 namespace devtools { | |
| 19 | |
| 20 class UIElementDelegate; | |
| 21 | |
| 22 class ASH_EXPORT WidgetElement : public views::WidgetRemovalsObserver, | |
| 23 public views::WidgetObserver, | |
| 24 public UIElement { | |
| 25 public: | |
| 26 WidgetElement(views::Widget* widget, | |
| 27 UIElementDelegate* ui_element_delegate, | |
| 28 UIElement* parent); | |
| 29 ~WidgetElement() override; | |
| 30 views::Widget* widget() const { return widget_; }; | |
| 31 | |
| 32 // views::WidgetRemovalsObserver: | |
| 33 void OnWillRemoveView(views::Widget* widget, views::View* view) override; | |
| 34 | |
| 35 // views::WidgetObserver: | |
| 36 void OnWidgetBoundsChanged(views::Widget* widget, | |
| 37 const gfx::Rect& new_bounds) override; | |
| 38 | |
| 39 // UIElement: | |
| 40 void Destroy() override; | |
| 41 void GetBounds(gfx::Rect* bounds) const override; | |
| 42 void SetBounds(const gfx::Rect& bounds) override; | |
| 43 void GetVisible(bool* visible) const override; | |
| 44 void SetVisible(bool visible) override; | |
| 45 std::pair<aura::Window*, gfx::Rect> GetNodeWindowAndBounds() const override; | |
| 46 | |
| 47 static views::Widget* From(UIElement* element); | |
| 48 | |
| 49 private: | |
| 50 views::Widget* widget_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(WidgetElement); | |
| 53 }; | |
| 54 | |
| 55 } // namespace devtools | |
| 56 } // namespace ash | |
| 57 | |
| 58 #endif // ASH_DEVTOOLS_WIDGET_ELEMENT_H_ | |
| OLD | NEW |