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

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

Issue 2776543002: Create a unified UIElement interface for Widget, View and Window. (Closed)
Patch Set: nits 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_VIEW_ELEMENT_H_
6 #define ASH_COMMON_DEVTOOLS_VIEW_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/view.h"
14 #include "ui/views/view_observer.h"
15
16 namespace ash {
17 namespace devtools {
18
19 class UIElementDelegate;
20
21 class ASH_EXPORT ViewElement : public views::ViewObserver, public UIElement {
22 public:
23 ViewElement(views::View* view,
24 UIElementDelegate* ui_element_delegate,
25 UIElement* parent);
26 ~ViewElement() override;
27 views::View* view();
28
29 // views::ViewObserver
30 void OnChildViewRemoved(views::View* parent, views::View* view) override;
31 void OnChildViewAdded(views::View* parent, views::View* view) override;
32 void OnChildViewReordered(views::View* parent, views::View*) override;
33 void OnViewBoundsChanged(views::View* view) 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<aura::Window*, gfx::Rect> GetNodeWindowAndBounds() override;
42 static views::View* From(UIElement* element);
43
44 private:
45 views::View* view_;
46
47 DISALLOW_COPY_AND_ASSIGN(ViewElement);
48 };
49
50 } // namespace devtools
51 } // namespace ash
52
53 #endif // ASH_COMMON_DEVTOOLS_VIEW_ELEMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698