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

Side by Side Diff: ash/common/devtools/ui_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_UI_ELEMENT_H_
6 #define ASH_COMMON_DEVTOOLS_UI_ELEMENT_H_
7
8 #include "ash/ash_export.h"
9 #include "ash/common/devtools/ui_element_delegate.h"
10 #include "ui/gfx/geometry/rect.h"
11
12 namespace ash {
13 namespace devtools {
14
15 class ASH_EXPORT UIElement : public UIElementDelegate {
16 public:
17 UIElement();
18 ~UIElement();
19 static UIElement* GetInstance();
20 UIElement(int node_id);
21
22 static UIElement* ConvertNodeIdToUIElement(int node_id);
23 virtual bool GetBounds(gfx::Rect* bounds){};
24 virtual bool SetBounds(const gfx::Rect& bounds){};
25 virtual bool GetVisible(bool* visible){};
26 virtual bool SetVisible(bool visible){};
27
28 int GetNodeId() const;
29
30 private:
31 int node_id_;
32 std::unordered_map<int, UIElement*> node_id_to_ui_element;
33 static UIElement* instance_;
34
35 DISALLOW_COPY_AND_ASSIGN(UIElement);
36 };
37
38 } // namespace devtools
39 } // namespace ash
40
41 #endif // ASH_COMMON_DEVTOOLS_UI_ELEMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698