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" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 std::vector<ServerView*> GetChildren(); | 53 std::vector<ServerView*> GetChildren(); |
54 | 54 |
55 // Returns true if this contains |view| or is |view|. | 55 // Returns true if this contains |view| or is |view|. |
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 float opacity() const { return opacity_; } | |
64 void SetOpacity(float value); | |
65 | |
63 const std::map<std::string, std::vector<uint8_t>>& properties() const { | 66 const std::map<std::string, std::vector<uint8_t>>& properties() const { |
64 return properties_; | 67 return properties_; |
65 } | 68 } |
66 void SetProperty(const std::string& name, const std::vector<uint8_t>* value); | 69 void SetProperty(const std::string& name, const std::vector<uint8_t>* value); |
67 | 70 |
68 // Returns true if this view is attached to |root| and all ancestors are | 71 // Returns true if this view is attached to |root| and all ancestors are |
69 // visible. | 72 // visible. |
70 bool IsDrawn(const ServerView* root) const; | 73 bool IsDrawn(const ServerView* root) const; |
71 | 74 |
72 void SetSurfaceId(cc::SurfaceId surface_id); | 75 void SetSurfaceId(cc::SurfaceId surface_id); |
73 const cc::SurfaceId surface_id() const { return surface_id_; } | 76 const cc::SurfaceId surface_id() const { return surface_id_; } |
74 | 77 |
75 private: | 78 private: |
76 typedef std::vector<ServerView*> Views; | 79 typedef std::vector<ServerView*> Views; |
77 | 80 |
78 // Implementation of removing a view. Doesn't send any notification. | 81 // Implementation of removing a view. Doesn't send any notification. |
79 void RemoveImpl(ServerView* view); | 82 void RemoveImpl(ServerView* view); |
80 | 83 |
81 ServerViewDelegate* delegate_; | 84 ServerViewDelegate* delegate_; |
82 const ViewId id_; | 85 const ViewId id_; |
83 ServerView* parent_; | 86 ServerView* parent_; |
84 Views children_; | 87 Views children_; |
85 bool visible_; | 88 bool visible_; |
86 gfx::Rect bounds_; | 89 gfx::Rect bounds_; |
87 cc::SurfaceId surface_id_; | 90 cc::SurfaceId surface_id_; |
91 float opacity_; | |
msw
2014/11/18 23:37:42
nit q: can you replace |visible_| with opacity_ >
sky
2014/11/19 00:49:39
Indeed. They are two separate things. Opacity isn'
msw
2014/11/19 01:27:51
Acknowledged.
| |
92 | |
88 std::map<std::string, std::vector<uint8_t>> properties_; | 93 std::map<std::string, std::vector<uint8_t>> properties_; |
89 | 94 |
90 DISALLOW_COPY_AND_ASSIGN(ServerView); | 95 DISALLOW_COPY_AND_ASSIGN(ServerView); |
91 }; | 96 }; |
92 | 97 |
93 } // namespace service | 98 } // namespace service |
94 } // namespace mojo | 99 } // namespace mojo |
95 | 100 |
96 #endif // MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ | 101 #endif // MOJO_SERVICES_VIEW_MANAGER_SERVER_VIEW_H_ |
OLD | NEW |