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