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_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_SYNCHRONIZER_H_ | 5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_SYNCHRONIZER_H_ |
6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_SYNCHRONIZER_H_ | 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_SYNCHRONIZER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" | 12 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" |
13 #include "mojo/services/public/cpp/view_manager/view_manager.h" | 13 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
14 #include "mojo/services/public/cpp/view_manager/view_manager_types.h" | 14 #include "mojo/services/public/cpp/view_manager/view_manager_types.h" |
| 15 #include "mojo/services/public/cpp/view_manager/view_tree_node.h" |
15 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | 16 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
16 | 17 |
17 class SkBitmap; | 18 class SkBitmap; |
18 | 19 |
19 namespace mojo { | 20 namespace mojo { |
20 namespace view_manager { | 21 namespace view_manager { |
21 | 22 |
22 class ViewManager; | 23 class ViewManager; |
23 class ViewManagerTransaction; | 24 class ViewManagerTransaction; |
24 | 25 |
(...skipping 14 matching lines...) Expand all Loading... |
39 | 40 |
40 Id CreateView(); | 41 Id CreateView(); |
41 void DestroyView(Id view_id); | 42 void DestroyView(Id view_id); |
42 | 43 |
43 // These methods take TransportIds. For views owned by the current connection, | 44 // These methods take TransportIds. For views owned by the current connection, |
44 // the connection id high word can be zero. In all cases, the TransportId 0x1 | 45 // the connection id high word can be zero. In all cases, the TransportId 0x1 |
45 // refers to the root node. | 46 // refers to the root node. |
46 void AddChild(Id child_id, Id parent_id); | 47 void AddChild(Id child_id, Id parent_id); |
47 void RemoveChild(Id child_id, Id parent_id); | 48 void RemoveChild(Id child_id, Id parent_id); |
48 | 49 |
| 50 void Reorder(Id node_id, Id relative_node_id, OrderDirection direction); |
| 51 |
49 // Returns true if the specified node/view was created by this connection. | 52 // Returns true if the specified node/view was created by this connection. |
50 bool OwnsNode(Id id) const; | 53 bool OwnsNode(Id id) const; |
51 bool OwnsView(Id id) const; | 54 bool OwnsView(Id id) const; |
52 | 55 |
53 void SetActiveView(Id node_id, Id view_id); | 56 void SetActiveView(Id node_id, Id view_id); |
54 void SetBounds(Id node_id, const gfx::Rect& bounds); | 57 void SetBounds(Id node_id, const gfx::Rect& bounds); |
55 void SetViewContents(Id view_id, const SkBitmap& contents); | 58 void SetViewContents(Id view_id, const SkBitmap& contents); |
56 | 59 |
57 void Embed(const String& url, Id node_id); | 60 void Embed(const String& url, Id node_id); |
58 | 61 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 virtual void OnRootsAdded(Array<INodePtr> nodes) OVERRIDE; | 102 virtual void OnRootsAdded(Array<INodePtr> nodes) OVERRIDE; |
100 virtual void OnServerChangeIdAdvanced(Id next_server_change_id) OVERRIDE; | 103 virtual void OnServerChangeIdAdvanced(Id next_server_change_id) OVERRIDE; |
101 virtual void OnNodeBoundsChanged(Id node_id, | 104 virtual void OnNodeBoundsChanged(Id node_id, |
102 RectPtr old_bounds, | 105 RectPtr old_bounds, |
103 RectPtr new_bounds) OVERRIDE; | 106 RectPtr new_bounds) OVERRIDE; |
104 virtual void OnNodeHierarchyChanged(Id node_id, | 107 virtual void OnNodeHierarchyChanged(Id node_id, |
105 Id new_parent_id, | 108 Id new_parent_id, |
106 Id old_parent_id, | 109 Id old_parent_id, |
107 Id server_change_id, | 110 Id server_change_id, |
108 Array<INodePtr> nodes) OVERRIDE; | 111 Array<INodePtr> nodes) OVERRIDE; |
| 112 virtual void OnNodeReordered(Id node_id, |
| 113 Id relative_node_id, |
| 114 OrderDirection direction, |
| 115 Id server_change_id) OVERRIDE; |
109 virtual void OnNodeDeleted(Id node_id, Id server_change_id) OVERRIDE; | 116 virtual void OnNodeDeleted(Id node_id, Id server_change_id) OVERRIDE; |
110 virtual void OnNodeViewReplaced(Id node, | 117 virtual void OnNodeViewReplaced(Id node, |
111 Id new_view_id, | 118 Id new_view_id, |
112 Id old_view_id) OVERRIDE; | 119 Id old_view_id) OVERRIDE; |
113 virtual void OnViewDeleted(Id view_id) OVERRIDE; | 120 virtual void OnViewDeleted(Id view_id) OVERRIDE; |
114 virtual void OnViewInputEvent(Id view, | 121 virtual void OnViewInputEvent(Id view, |
115 EventPtr event, | 122 EventPtr event, |
116 const Callback<void()>& callback) OVERRIDE; | 123 const Callback<void()>& callback) OVERRIDE; |
117 | 124 |
118 // Sync the client model with the service by enumerating the pending | 125 // Sync the client model with the service by enumerating the pending |
(...skipping 27 matching lines...) Expand all Loading... |
146 | 153 |
147 IViewManager* service_; | 154 IViewManager* service_; |
148 | 155 |
149 DISALLOW_COPY_AND_ASSIGN(ViewManagerSynchronizer); | 156 DISALLOW_COPY_AND_ASSIGN(ViewManagerSynchronizer); |
150 }; | 157 }; |
151 | 158 |
152 } // namespace view_manager | 159 } // namespace view_manager |
153 } // namespace mojo | 160 } // namespace mojo |
154 | 161 |
155 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_SYNCHRONIZER_H
_ | 162 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_SYNCHRONIZER_H
_ |
OLD | NEW |