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

Side by Side Diff: ash/devtools/window_element.h

Issue 2776543002: Create a unified UIElement interface for Widget, View and Window. (Closed)
Patch Set: rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(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_COMMON_DEVTOOLS_WINDOW_ELEMENT_H_
6 #define ASH_COMMON_DEVTOOLS_WINDOW_ELEMENT_H_
7
8 #include "ash/ash_export.h"
9 #include "ash/devtools/ui_element.h"
10 #include "ash/wm_window.h"
11 #include "base/macros.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(WmWindow* window, UIElementDelegate* ui_element_delegate);
21 WindowElement(WmWindow* window, int node_id);
22 ~WindowElement() override;
23 WmWindow* window();
24
25 // WindowObserver:
26 void OnWindowHierarchyChanging(
27 const aura::WindowObserver::HierarchyChangeParams& params) override;
28 void OnWindowHierarchyChanged(
29 const aura::WindowObserver::HierarchyChangeParams& params) override;
30 void OnWindowStackingChanged(aura::Window* window) override;
31 void OnWindowBoundsChanged(aura::Window* window,
32 const gfx::Rect& old_bounds,
33 const gfx::Rect& new_bounds) override;
34
35 // UIElement:
36 void Destroy() override;
37 bool GetBounds(gfx::Rect* bounds) override;
38 bool SetBounds(const gfx::Rect& bounds) override;
39 bool GetVisible(bool* visible) override;
40 bool SetVisible(bool visible) override;
41 std::pair<WmWindow*, gfx::Rect> GetNodeWindowAndBounds() override;
42
43 static WmWindow* From(UIElement* element);
44
45 private:
46 WmWindow* window_;
47
48 DISALLOW_COPY_AND_ASSIGN(WindowElement);
49 };
50
51 } // namespace devtools
52 } // namespace ash
53
54 #endif // ASH_COMMON_DEVTOOLS_WINDOW_ELEMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698