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_WINDOW_ELEMENT_H_ |
| 6 #define ASH_DEVTOOLS_WINDOW_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/aura/window_observer.h" |
| 13 #include "ui/gfx/geometry/rect.h" |
| 14 |
| 15 namespace ash { |
| 16 namespace devtools { |
| 17 |
| 18 class ASH_EXPORT WindowElement : public aura::WindowObserver, public UIElement { |
| 19 public: |
| 20 WindowElement(aura::Window* window, |
| 21 UIElementDelegate* ui_element_delegate, |
| 22 UIElement* parent); |
| 23 ~WindowElement() override; |
| 24 aura::Window* window() const { return window_; }; |
| 25 |
| 26 // WindowObserver: |
| 27 void OnWindowHierarchyChanging( |
| 28 const aura::WindowObserver::HierarchyChangeParams& params) override; |
| 29 void OnWindowHierarchyChanged( |
| 30 const aura::WindowObserver::HierarchyChangeParams& params) override; |
| 31 void OnWindowStackingChanged(aura::Window* window) override; |
| 32 void OnWindowBoundsChanged(aura::Window* window, |
| 33 const gfx::Rect& old_bounds, |
| 34 const gfx::Rect& new_bounds) override; |
| 35 |
| 36 // UIElement: |
| 37 void Destroy() override; |
| 38 void GetBounds(gfx::Rect* bounds) const override; |
| 39 void SetBounds(const gfx::Rect& bounds) override; |
| 40 void GetVisible(bool* visible) const override; |
| 41 void SetVisible(bool visible) override; |
| 42 std::pair<aura::Window*, gfx::Rect> GetNodeWindowAndBounds() const override; |
| 43 |
| 44 static aura::Window* From(UIElement* element); |
| 45 |
| 46 private: |
| 47 aura::Window* window_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(WindowElement); |
| 50 }; |
| 51 |
| 52 } // namespace devtools |
| 53 } // namespace ash |
| 54 |
| 55 #endif // ASH_DEVTOOLS_WINDOW_ELEMENT_H_ |
OLD | NEW |