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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // Returns true if the window is visible. This does not consider visibility | 59 // Returns true if the window is visible. This does not consider visibility |
60 // of any ancestors. | 60 // of any ancestors. |
61 bool visible() const { return visible_; } | 61 bool visible() const { return visible_; } |
62 void SetVisible(bool value); | 62 void SetVisible(bool value); |
63 | 63 |
64 // Returns true if this view is attached to |root| and all ancestors are | 64 // Returns true if this view is attached to |root| and all ancestors are |
65 // visible. | 65 // visible. |
66 bool IsDrawn(const ServerView* root) const; | 66 bool IsDrawn(const ServerView* root) const; |
67 | 67 |
68 void SetBitmap(const SkBitmap& contents); | 68 void SetSurfaceId(cc::SurfaceId surface_id); |
69 const SkBitmap& bitmap() const { return bitmap_; } | 69 const cc::SurfaceId surface_id() const { return surface_id_; } |
70 | 70 |
71 private: | 71 private: |
72 typedef std::vector<ServerView*> Views; | 72 typedef std::vector<ServerView*> Views; |
73 | 73 |
74 // Implementation of removing a view. Doesn't send any notification. | 74 // Implementation of removing a view. Doesn't send any notification. |
75 void RemoveImpl(ServerView* view); | 75 void RemoveImpl(ServerView* view); |
76 | 76 |
77 ServerViewDelegate* delegate_; | 77 ServerViewDelegate* delegate_; |
78 const ViewId id_; | 78 const ViewId id_; |
79 ServerView* parent_; | 79 ServerView* parent_; |
80 Views children_; | 80 Views children_; |
81 bool visible_; | 81 bool visible_; |
82 gfx::Rect bounds_; | 82 gfx::Rect bounds_; |
83 SkBitmap bitmap_; | 83 cc::SurfaceId surface_id_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(ServerView); | 85 DISALLOW_COPY_AND_ASSIGN(ServerView); |
86 }; | 86 }; |
87 | 87 |
88 } // namespace service | 88 } // namespace service |
89 } // namespace mojo | 89 } // namespace mojo |
90 | 90 |
91 #endif // MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ | 91 #endif // MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ |
OLD | NEW |