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

Side by Side Diff: ash/devtools/view_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_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/gfx/geometry/rect.h"
12 #include "ui/views/view.h"
13 #include "ui/views/view_observer.h"
14
15 namespace ash {
16 namespace devtools {
17
18 class UIElementDelegate;
19
20 class ASH_EXPORT ViewElement : public views::ViewObserver, public UIElement {
21 public:
22 ViewElement(views::View* view, UIElementDelegate* ui_element_delegate);
23 ViewElement(views::View* view, int node_id);
24 ~ViewElement() override;
25 views::View* view();
26
27 // views::ViewObserver
28 void OnChildViewRemoved(views::View* parent, views::View* view) override;
29 void OnChildViewAdded(views::View* parent, views::View* view) override;
30 void OnChildViewReordered(views::View* parent, views::View*) override;
31 void OnViewBoundsChanged(views::View* view) override;
32
33 // UIElement:
34 void Destroy() override;
35 bool GetBounds(gfx::Rect* bounds) override;
36 bool SetBounds(const gfx::Rect& bounds) override;
37 bool GetVisible(bool* visible) override;
38 bool SetVisible(bool visible) override;
39 std::pair<WmWindow*, gfx::Rect> GetNodeWindowAndBounds() override;
40 static views::View* From(UIElement* element);
41
42 private:
43 views::View* view_;
44
45 DISALLOW_COPY_AND_ASSIGN(ViewElement);
46 };
47
48 } // namespace devtools
49 } // namespace ash
50
51 #endif // ASH_COMMON_DEVTOOLS_VIEW_ELEMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698