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_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_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" |
(...skipping 21 matching lines...) Expand all Loading... |
32 Shell* shell, | 32 Shell* shell, |
33 ScopedMessagePipeHandle handle, | 33 ScopedMessagePipeHandle handle, |
34 bool delete_on_error); | 34 bool delete_on_error); |
35 ~ViewManagerClientImpl() override; | 35 ~ViewManagerClientImpl() override; |
36 | 36 |
37 bool connected() const { return connected_; } | 37 bool connected() const { return connected_; } |
38 ConnectionSpecificId connection_id() const { return connection_id_; } | 38 ConnectionSpecificId connection_id() const { return connection_id_; } |
39 | 39 |
40 // API exposed to the view implementations that pushes local changes to the | 40 // API exposed to the view implementations that pushes local changes to the |
41 // service. | 41 // service. |
42 Id CreateView(); | |
43 void DestroyView(Id view_id); | 42 void DestroyView(Id view_id); |
44 | 43 |
45 // These methods take TransportIds. For views owned by the current connection, | 44 // These methods take TransportIds. For views owned by the current connection, |
46 // 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 |
47 // refers to the root view. | 46 // refers to the root view. |
48 void AddChild(Id child_id, Id parent_id); | 47 void AddChild(Id child_id, Id parent_id); |
49 void RemoveChild(Id child_id, Id parent_id); | 48 void RemoveChild(Id child_id, Id parent_id); |
50 | 49 |
51 void Reorder(Id view_id, Id relative_view_id, OrderDirection direction); | 50 void Reorder(Id view_id, Id relative_view_id, OrderDirection direction); |
52 | 51 |
(...skipping 23 matching lines...) Expand all Loading... |
76 // Start/stop tracking views. While tracked, they can be retrieved via | 75 // Start/stop tracking views. While tracked, they can be retrieved via |
77 // ViewManager::GetViewById. | 76 // ViewManager::GetViewById. |
78 void AddView(View* view); | 77 void AddView(View* view); |
79 void RemoveView(Id view_id); | 78 void RemoveView(Id view_id); |
80 | 79 |
81 private: | 80 private: |
82 friend class RootObserver; | 81 friend class RootObserver; |
83 | 82 |
84 typedef std::map<Id, View*> IdToViewMap; | 83 typedef std::map<Id, View*> IdToViewMap; |
85 | 84 |
| 85 Id CreateViewOnServer(); |
| 86 |
86 // Overridden from ViewManager: | 87 // Overridden from ViewManager: |
87 const std::string& GetEmbedderURL() const override; | 88 const std::string& GetEmbedderURL() const override; |
88 View* GetRoot() override; | 89 View* GetRoot() override; |
89 View* GetViewById(Id id) override; | 90 View* GetViewById(Id id) override; |
90 View* GetFocusedView() override; | 91 View* GetFocusedView() override; |
| 92 View* CreateView() override; |
91 | 93 |
92 // Overridden from ViewManagerClient: | 94 // Overridden from ViewManagerClient: |
93 void OnEmbed(ConnectionSpecificId connection_id, | 95 void OnEmbed(ConnectionSpecificId connection_id, |
94 const String& creator_url, | 96 const String& creator_url, |
95 ViewDataPtr root, | 97 ViewDataPtr root, |
96 InterfaceRequest<ServiceProvider> parent_services, | 98 InterfaceRequest<ServiceProvider> parent_services, |
97 ScopedMessagePipeHandle window_manager_pipe) override; | 99 ScopedMessagePipeHandle window_manager_pipe) override; |
98 void OnEmbeddedAppDisconnected(Id view_id) override; | 100 void OnEmbeddedAppDisconnected(Id view_id) override; |
99 void OnViewBoundsChanged(Id view_id, | 101 void OnViewBoundsChanged(Id view_id, |
100 RectPtr old_bounds, | 102 RectPtr old_bounds, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 Binding<ViewManagerClient> binding_; | 163 Binding<ViewManagerClient> binding_; |
162 ViewManagerService* service_; | 164 ViewManagerService* service_; |
163 const bool delete_on_error_; | 165 const bool delete_on_error_; |
164 | 166 |
165 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); | 167 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); |
166 }; | 168 }; |
167 | 169 |
168 } // namespace mojo | 170 } // namespace mojo |
169 | 171 |
170 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 172 #endif // MOJO_SERVICES_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
OLD | NEW |