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