| 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 #include "mojo/services/public/cpp/view_manager/view_manager.h" | 5 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "mojo/public/cpp/application/application.h" | 9 #include "mojo/public/cpp/application/application.h" |
| 10 #include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h" | 10 #include "mojo/services/public/cpp/view_manager/lib/view_manager_private.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 views_.erase(it); | 34 views_.erase(it); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 // static | 38 // static |
| 39 void ViewManager::Create(Application* application, | 39 void ViewManager::Create(Application* application, |
| 40 ViewManagerDelegate* delegate) { | 40 ViewManagerDelegate* delegate) { |
| 41 application->AddService<ViewManagerSynchronizer>(delegate); | 41 application->AddService<ViewManagerSynchronizer>(delegate); |
| 42 } | 42 } |
| 43 | 43 |
| 44 ViewTreeNode* ViewManager::GetNodeById(TransportNodeId id) { | 44 ViewTreeNode* ViewManager::GetNodeById(Id id) { |
| 45 IdToNodeMap::const_iterator it = nodes_.find(id); | 45 IdToNodeMap::const_iterator it = nodes_.find(id); |
| 46 return it != nodes_.end() ? it->second : NULL; | 46 return it != nodes_.end() ? it->second : NULL; |
| 47 } | 47 } |
| 48 | 48 |
| 49 View* ViewManager::GetViewById(TransportViewId id) { | 49 View* ViewManager::GetViewById(Id id) { |
| 50 IdToViewMap::const_iterator it = views_.find(id); | 50 IdToViewMap::const_iterator it = views_.find(id); |
| 51 return it != views_.end() ? it->second : NULL; | 51 return it != views_.end() ? it->second : NULL; |
| 52 } | 52 } |
| 53 | 53 |
| 54 //////////////////////////////////////////////////////////////////////////////// | 54 //////////////////////////////////////////////////////////////////////////////// |
| 55 // ViewManager, private: | 55 // ViewManager, private: |
| 56 | 56 |
| 57 ViewManager::ViewManager(ViewManagerSynchronizer* synchronizer, | 57 ViewManager::ViewManager(ViewManagerSynchronizer* synchronizer, |
| 58 ViewManagerDelegate* delegate) | 58 ViewManagerDelegate* delegate) |
| 59 : delegate_(delegate), | 59 : delegate_(delegate), |
| 60 synchronizer_(synchronizer) {} | 60 synchronizer_(synchronizer) {} |
| 61 | 61 |
| 62 } // namespace view_manager | 62 } // namespace view_manager |
| 63 } // namespace mojo | 63 } // namespace mojo |
| OLD | NEW |