OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "cc/surfaces/surface_id.h" |
11 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | 12 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
12 #include "mojo/services/view_manager/ids.h" | 13 #include "mojo/services/view_manager/ids.h" |
13 #include "mojo/services/view_manager/view_manager_export.h" | 14 #include "mojo/services/view_manager/view_manager_export.h" |
14 #include "third_party/skia/include/core/SkBitmap.h" | |
15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace service { | 18 namespace service { |
19 | 19 |
20 class ServerViewDelegate; | 20 class ServerViewDelegate; |
21 | 21 |
22 // Server side representation of a view. Delegate is informed of interesting | 22 // Server side representation of a view. Delegate is informed of interesting |
23 // events. | 23 // events. |
24 // | 24 // |
(...skipping 28 matching lines...) Expand all Loading... |
53 std::vector<const ServerView*> GetChildren() const; | 53 std::vector<const ServerView*> GetChildren() const; |
54 std::vector<ServerView*> GetChildren(); | 54 std::vector<ServerView*> GetChildren(); |
55 | 55 |
56 bool Contains(const ServerView* view) const; | 56 bool Contains(const ServerView* view) const; |
57 | 57 |
58 // Returns true if the window is visible. This does not consider visibility | 58 // Returns true if the window is visible. This does not consider visibility |
59 // of any ancestors. | 59 // of any ancestors. |
60 bool visible() const { return visible_; } | 60 bool visible() const { return visible_; } |
61 void SetVisible(bool value); | 61 void SetVisible(bool value); |
62 | 62 |
63 void SetBitmap(const SkBitmap& contents); | 63 void SetSurfaceId(cc::SurfaceId surface_id); |
64 const SkBitmap& bitmap() const { return bitmap_; } | 64 const cc::SurfaceId surface_id() const { return surface_id_; } |
65 | 65 |
66 private: | 66 private: |
67 typedef std::vector<ServerView*> Views; | 67 typedef std::vector<ServerView*> Views; |
68 | 68 |
69 // Implementation of removing a view. Doesn't send any notification. | 69 // Implementation of removing a view. Doesn't send any notification. |
70 void RemoveImpl(ServerView* view); | 70 void RemoveImpl(ServerView* view); |
71 | 71 |
72 ServerViewDelegate* delegate_; | 72 ServerViewDelegate* delegate_; |
73 const ViewId id_; | 73 const ViewId id_; |
74 ServerView* parent_; | 74 ServerView* parent_; |
75 Views children_; | 75 Views children_; |
76 bool visible_; | 76 bool visible_; |
77 gfx::Rect bounds_; | 77 gfx::Rect bounds_; |
78 SkBitmap bitmap_; | 78 cc::SurfaceId surface_id_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(ServerView); | 80 DISALLOW_COPY_AND_ASSIGN(ServerView); |
81 }; | 81 }; |
82 | 82 |
83 } // namespace service | 83 } // namespace service |
84 } // namespace mojo | 84 } // namespace mojo |
85 | 85 |
86 #endif // MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ | 86 #endif // MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ |
OLD | NEW |