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_VIEW_MANAGER_H_ | 5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ |
6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ | 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // Owned by the connection. | 27 // Owned by the connection. |
28 class ViewManager { | 28 class ViewManager { |
29 public: | 29 public: |
30 ~ViewManager(); | 30 ~ViewManager(); |
31 | 31 |
32 // Delegate is owned by the caller. | 32 // Delegate is owned by the caller. |
33 static void Create(Application* application, ViewManagerDelegate* delegate); | 33 static void Create(Application* application, ViewManagerDelegate* delegate); |
34 | 34 |
35 const std::vector<ViewTreeNode*>& roots() { return roots_; } | 35 const std::vector<ViewTreeNode*>& roots() { return roots_; } |
36 | 36 |
37 ViewTreeNode* GetNodeById(TransportNodeId id); | 37 ViewTreeNode* GetNodeById(Id id); |
38 View* GetViewById(TransportViewId id); | 38 View* GetViewById(Id id); |
39 | 39 |
40 private: | 40 private: |
41 friend class ViewManagerPrivate; | 41 friend class ViewManagerPrivate; |
42 friend class ViewManagerSynchronizer; | 42 friend class ViewManagerSynchronizer; |
43 | 43 |
44 typedef std::map<TransportNodeId, ViewTreeNode*> IdToNodeMap; | 44 typedef std::map<Id, ViewTreeNode*> IdToNodeMap; |
45 typedef std::map<TransportViewId, View*> IdToViewMap; | 45 typedef std::map<Id, View*> IdToViewMap; |
46 typedef std::map<TransportConnectionId, | 46 typedef std::map<ConnectionSpecificId, |
47 ViewManagerSynchronizer*> SynchronizerMap; | 47 ViewManagerSynchronizer*> SynchronizerMap; |
48 | 48 |
49 ViewManager(ViewManagerSynchronizer* synchronizer, | 49 ViewManager(ViewManagerSynchronizer* synchronizer, |
50 ViewManagerDelegate* delegate); | 50 ViewManagerDelegate* delegate); |
51 | 51 |
52 ViewManagerDelegate* delegate_; | 52 ViewManagerDelegate* delegate_; |
53 ViewManagerSynchronizer* synchronizer_; | 53 ViewManagerSynchronizer* synchronizer_; |
54 | 54 |
55 std::vector<ViewTreeNode*> roots_; | 55 std::vector<ViewTreeNode*> roots_; |
56 | 56 |
57 IdToNodeMap nodes_; | 57 IdToNodeMap nodes_; |
58 IdToViewMap views_; | 58 IdToViewMap views_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(ViewManager); | 60 DISALLOW_COPY_AND_ASSIGN(ViewManager); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace view_manager | 63 } // namespace view_manager |
64 } // namespace mojo | 64 } // namespace mojo |
65 | 65 |
66 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ | 66 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ |
OLD | NEW |