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 void NotifyReady() { | |
23 manager_->ready_callback_.Run(manager_); | |
24 } | |
25 | |
26 ViewManagerSynchronizer* synchronizer() { | 22 ViewManagerSynchronizer* synchronizer() { |
27 return manager_->synchronizer_; | 23 return manager_->synchronizer_; |
28 } | 24 } |
29 void set_synchronizer(ViewManagerSynchronizer* synchronizer) { | 25 void set_synchronizer(ViewManagerSynchronizer* synchronizer) { |
30 manager_->synchronizer_ = synchronizer; | 26 manager_->synchronizer_ = synchronizer; |
31 } | 27 } |
32 | 28 |
33 void set_root(ViewTreeNode* root) { manager_->tree_ = root; } | 29 void AddRoot(ViewTreeNode* root); |
| 30 void RemoveRoot(ViewTreeNode* root); |
34 | 31 |
35 void AddNode(TransportNodeId node_id, ViewTreeNode* node); | 32 void AddNode(TransportNodeId node_id, ViewTreeNode* node); |
36 void RemoveNode(TransportNodeId node_id); | 33 void RemoveNode(TransportNodeId node_id); |
37 | 34 |
38 void AddView(TransportViewId view_id, View* view); | 35 void AddView(TransportViewId view_id, View* view); |
39 void RemoveView(TransportViewId view_id); | 36 void RemoveView(TransportViewId view_id); |
40 | 37 |
41 // Returns true if the ViewManager's synchronizer is connected to the service. | 38 // Returns true if the ViewManager's synchronizer is connected to the service. |
42 bool connected() { return manager_->synchronizer_->connected(); } | 39 bool connected() { return manager_->synchronizer_->connected(); } |
43 | 40 |
44 private: | 41 private: |
45 ViewManager* manager_; | 42 ViewManager* manager_; |
46 | 43 |
47 DISALLOW_COPY_AND_ASSIGN(ViewManagerPrivate); | 44 DISALLOW_COPY_AND_ASSIGN(ViewManagerPrivate); |
48 }; | 45 }; |
49 | 46 |
50 } // namespace view_manager | 47 } // namespace view_manager |
51 } // namespace mojo | 48 } // namespace mojo |
52 | 49 |
53 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_PRIVATE_H_ | 50 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_PRIVATE_H_ |
OLD | NEW |