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> | |
9 | |
10 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
12 #include "mojo/public/cpp/bindings/callback.h" | 10 #include "mojo/public/cpp/bindings/callback.h" |
13 #include "mojo/services/public/cpp/view_manager/view_tree_node.h" | 11 #include "mojo/services/public/cpp/view_manager/view_tree_node.h" |
14 | 12 |
15 namespace mojo { | 13 namespace mojo { |
16 class Shell; | 14 class Shell; |
17 namespace services { | 15 namespace services { |
18 namespace view_manager { | 16 namespace view_manager { |
19 | 17 |
(...skipping 14 matching lines...) Expand all Loading... |
34 // using any other View Manager lib class or function. | 32 // using any other View Manager lib class or function. |
35 // Blocks on establishing the connection and subsequently receiving a node | 33 // Blocks on establishing the connection and subsequently receiving a node |
36 // tree from the service. | 34 // tree from the service. |
37 // TODO(beng): blocking is currently achieved by running a nested runloop, | 35 // TODO(beng): blocking is currently achieved by running a nested runloop, |
38 // which will dispatch all messages on all pipes while blocking. | 36 // which will dispatch all messages on all pipes while blocking. |
39 // we should instead wait on the client pipe receiving a | 37 // we should instead wait on the client pipe receiving a |
40 // connection established message. | 38 // connection established message. |
41 // TODO(beng): this method could optionally not block if supplied a callback. | 39 // TODO(beng): this method could optionally not block if supplied a callback. |
42 void Init(); | 40 void Init(); |
43 | 41 |
44 ViewTreeNode* tree() { return tree_; } | 42 ViewTreeNode* tree() { return tree_.get(); } |
45 | |
46 ViewTreeNode* GetNodeById(TransportNodeId id); | |
47 | 43 |
48 private: | 44 private: |
49 friend class ViewManagerPrivate; | 45 friend class ViewManagerPrivate; |
50 typedef std::map<TransportNodeId, ViewTreeNode*> IdToNodeMap; | |
51 | 46 |
52 Shell* shell_; | 47 Shell* shell_; |
53 scoped_ptr<ViewManagerSynchronizer> synchronizer_; | 48 scoped_ptr<ViewManagerSynchronizer> synchronizer_; |
54 ViewTreeNode* tree_; | 49 scoped_ptr<ViewTreeNode> tree_; |
55 | |
56 IdToNodeMap nodes_; | |
57 | 50 |
58 DISALLOW_COPY_AND_ASSIGN(ViewManager); | 51 DISALLOW_COPY_AND_ASSIGN(ViewManager); |
59 }; | 52 }; |
60 | 53 |
61 } // namespace view_manager | 54 } // namespace view_manager |
62 } // namespace services | 55 } // namespace services |
63 } // namespace mojo | 56 } // namespace mojo |
64 | 57 |
65 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ | 58 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_MANAGER_H_ |
OLD | NEW |