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_PRIVATE_H_ | 5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_PRIVATE_H_ |
6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_PRIVATE_H_ | 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_PRIVATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h" | 9 #include "mojo/services/public/cpp/view_manager/lib/view_manager_synchronizer.h" |
10 #include "mojo/services/public/cpp/view_manager/view_manager.h" | 10 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 namespace view_manager { | 13 namespace view_manager { |
14 | 14 |
15 class ViewManagerSynchronizer; | 15 class ViewManagerSynchronizer; |
16 | 16 |
17 class ViewManagerPrivate { | 17 class ViewManagerPrivate { |
18 public: | 18 public: |
19 explicit ViewManagerPrivate(ViewManager* manager); | 19 explicit ViewManagerPrivate(ViewManager* manager); |
20 ~ViewManagerPrivate(); | 20 ~ViewManagerPrivate(); |
21 | 21 |
22 ViewManagerSynchronizer* synchronizer() { | 22 ViewManagerSynchronizer* synchronizer() { |
23 return manager_->synchronizer_.get(); | 23 return manager_->synchronizer_; |
24 } | 24 } |
25 ServiceProvider* service_provider() { return manager_->service_provider_; } | 25 void set_synchronizer(ViewManagerSynchronizer* synchronizer) { |
| 26 manager_->synchronizer_ = synchronizer; |
| 27 } |
26 | 28 |
27 void set_root(ViewTreeNode* root) { manager_->tree_ = root; } | 29 void set_root(ViewTreeNode* root) { manager_->tree_ = root; } |
28 | 30 |
29 void AddNode(TransportNodeId node_id, ViewTreeNode* node); | 31 void AddNode(TransportNodeId node_id, ViewTreeNode* node); |
30 void RemoveNode(TransportNodeId node_id); | 32 void RemoveNode(TransportNodeId node_id); |
31 | 33 |
32 void AddView(TransportViewId view_id, View* view); | 34 void AddView(TransportViewId view_id, View* view); |
33 void RemoveView(TransportViewId view_id); | 35 void RemoveView(TransportViewId view_id); |
34 | 36 |
35 // Returns true if the ViewManager's synchronizer is connected to the service. | 37 // Returns true if the ViewManager's synchronizer is connected to the service. |
36 bool connected() { return manager_->synchronizer_->connected(); } | 38 bool connected() { return manager_->synchronizer_->connected(); } |
37 | 39 |
38 private: | 40 private: |
39 ViewManager* manager_; | 41 ViewManager* manager_; |
40 | 42 |
41 DISALLOW_COPY_AND_ASSIGN(ViewManagerPrivate); | 43 DISALLOW_COPY_AND_ASSIGN(ViewManagerPrivate); |
42 }; | 44 }; |
43 | 45 |
44 } // namespace view_manager | 46 } // namespace view_manager |
45 } // namespace mojo | 47 } // namespace mojo |
46 | 48 |
47 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_PRIVATE_H_ | 49 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_PRIVATE_H_ |
OLD | NEW |