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_VIEW_MANAGER_SERVICE_IMPL_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // Returns the View with the specified id. | 58 // Returns the View with the specified id. |
59 ServerView* GetView(const ViewId& id) { | 59 ServerView* GetView(const ViewId& id) { |
60 return const_cast<ServerView*>( | 60 return const_cast<ServerView*>( |
61 const_cast<const ViewManagerServiceImpl*>(this)->GetView(id)); | 61 const_cast<const ViewManagerServiceImpl*>(this)->GetView(id)); |
62 } | 62 } |
63 const ServerView* GetView(const ViewId& id) const; | 63 const ServerView* GetView(const ViewId& id) const; |
64 | 64 |
65 // Returns true if this connection's root is |id|. | 65 // Returns true if this connection's root is |id|. |
66 bool IsRoot(const ViewId& id) const; | 66 bool IsRoot(const ViewId& id) const; |
67 | 67 |
| 68 // Returns the id of the root node. This is null if the root has been |
| 69 // destroyed but the connection is still valid. |
| 70 const ViewId* root() const { return root_.get(); } |
| 71 |
68 // Invoked when a connection is about to be destroyed. | 72 // Invoked when a connection is about to be destroyed. |
69 void OnWillDestroyViewManagerServiceImpl(ViewManagerServiceImpl* connection); | 73 void OnWillDestroyViewManagerServiceImpl(ViewManagerServiceImpl* connection); |
70 | 74 |
71 // Synchronous implementation of ViewManagerService::CreateView(), see the | 75 // These functions are synchronous variants of those defined in the mojom. The |
72 // mojom for details. | 76 // ViewManagerService implementations all call into these. See the mojom for |
| 77 // details. |
73 ErrorCode CreateView(const ViewId& view_id); | 78 ErrorCode CreateView(const ViewId& view_id); |
| 79 bool AddView(const ViewId& parent_id, const ViewId& child_id); |
| 80 std::vector<const ServerView*> GetViewTree(const ViewId& view_id) const; |
| 81 bool SetViewVisibility(const ViewId& view_id, bool visible); |
| 82 bool Embed(const std::string& url, |
| 83 const ViewId& view_id, |
| 84 InterfaceRequest<ServiceProvider> service_provider); |
74 | 85 |
75 // The following methods are invoked after the corresponding change has been | 86 // The following methods are invoked after the corresponding change has been |
76 // processed. They do the appropriate bookkeeping and update the client as | 87 // processed. They do the appropriate bookkeeping and update the client as |
77 // necessary. | 88 // necessary. |
78 void ProcessViewBoundsChanged(const ServerView* view, | 89 void ProcessViewBoundsChanged(const ServerView* view, |
79 const gfx::Rect& old_bounds, | 90 const gfx::Rect& old_bounds, |
80 const gfx::Rect& new_bounds, | 91 const gfx::Rect& new_bounds, |
81 bool originated_change); | 92 bool originated_change); |
82 void ProcessWillChangeViewHierarchy(const ServerView* view, | 93 void ProcessWillChangeViewHierarchy(const ServerView* view, |
83 const ServerView* new_parent, | 94 const ServerView* new_parent, |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // is destroyed or Embed() is invoked on the root. | 232 // is destroyed or Embed() is invoked on the root. |
222 scoped_ptr<ViewId> root_; | 233 scoped_ptr<ViewId> root_; |
223 | 234 |
224 DISALLOW_COPY_AND_ASSIGN(ViewManagerServiceImpl); | 235 DISALLOW_COPY_AND_ASSIGN(ViewManagerServiceImpl); |
225 }; | 236 }; |
226 | 237 |
227 } // namespace service | 238 } // namespace service |
228 } // namespace mojo | 239 } // namespace mojo |
229 | 240 |
230 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ | 241 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ |
OLD | NEW |