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

Side by Side Diff: ash/common/devtools/widget_element.h

Issue 2776543002: Create a unified UIElement interface for Widget, View and Window. (Closed)
Patch Set: . Created 3 years, 9 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_WIDGET_ELEMENT_H_
6 #define ASH_COMMON_DEVTOOLS_WIDGET_ELEMENT_H_
7
8 #include "ash/common/devtools/ui_element.h"
9 #include "ui/gfx/geometry/rect.h"
10 #include "ui/views/widget/widget.h"
11 #include "ui/views/widget/widget_observer.h"
12 #include "ui/views/widget/widget_removals_observer.h"
13
14 namespace ash {
15 namespace devtools {
16
17 class WidgetElement : public views::WidgetObserver,
18 public views::WidgetRemovalsObserver,
19 public UIElement {
20 public:
21 WidgetElement(views::Widget* widget);
22
23 // views::WidgetRemovalsObserver:
24 void OnWillRemoveView(views::Widget* widget, views::View* view) override;
25
26 // views::WidgetObserver:
27 void OnWidgetBoundsChanged(views::Widget* widget,
28 const gfx::Rect& new_bounds) override;
29
30 bool GetBounds(gfx::Rect* bounds) override;
31 bool SetBounds(const gfx::Rect& bounds) override;
32 bool GetVisible(bool* visible) override;
33 bool SetVisible(bool visible) override;
34
35 private:
36 views::Widget* widget_;
37
38 DISALLOW_COPY_AND_ASSIGN(WidgetElement);
39 };
40
41 } // namespace devtools
42 } // namespace ash
43
44 #endif // ASH_COMMON_DEVTOOLS_WIDGET_ELEMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698