OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "services/ui/view_manager/view_registry.h" | 5 #include "services/ui/view_manager/view_registry.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 ViewRegistry::~ViewRegistry() {} | 60 ViewRegistry::~ViewRegistry() {} |
61 | 61 |
62 void ViewRegistry::ConnectAssociates( | 62 void ViewRegistry::ConnectAssociates( |
63 mojo::ApplicationImpl* app_impl, | 63 mojo::ApplicationImpl* app_impl, |
64 const std::vector<std::string>& urls, | 64 const std::vector<std::string>& urls, |
65 const AssociateConnectionErrorCallback& connection_error_callback) { | 65 const AssociateConnectionErrorCallback& connection_error_callback) { |
66 associate_table_.ConnectAssociates(app_impl, this, urls, | 66 associate_table_.ConnectAssociates(app_impl, this, urls, |
67 connection_error_callback); | 67 connection_error_callback); |
68 } | 68 } |
69 | 69 |
70 // REGISTERING ASSOCIATES | |
71 | |
72 void ViewRegistry::RegisterViewAssociate( | |
73 mojo::ui::ViewInspector* view_inspector, | |
74 mojo::ui::ViewAssociatePtr view_associate) { | |
jeffbrown
2016/05/11 23:44:20
// TODO(mikejurka): Delete callback once registrat
mikejurka
2016/05/16 23:35:18
Done.
| |
75 AssociateConnectionErrorCallback null_callback; | |
76 associate_table_.RegisterViewAssociate(view_inspector, view_associate.Pass(), | |
77 null_callback); | |
78 } | |
79 | |
70 // CREATE / DESTROY VIEWS | 80 // CREATE / DESTROY VIEWS |
71 | 81 |
72 void ViewRegistry::CreateView( | 82 void ViewRegistry::CreateView( |
73 mojo::InterfaceRequest<mojo::ui::View> view_request, | 83 mojo::InterfaceRequest<mojo::ui::View> view_request, |
74 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, | 84 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, |
75 mojo::ui::ViewListenerPtr view_listener, | 85 mojo::ui::ViewListenerPtr view_listener, |
76 const mojo::String& label) { | 86 const mojo::String& label) { |
77 DCHECK(view_request.is_pending()); | 87 DCHECK(view_request.is_pending()); |
78 DCHECK(view_owner_request.is_pending()); | 88 DCHECK(view_owner_request.is_pending()); |
79 DCHECK(view_listener); | 89 DCHECK(view_listener); |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
767 auto it = views_by_token_.find(view_token_value); | 777 auto it = views_by_token_.find(view_token_value); |
768 return it != views_by_token_.end() ? it->second : nullptr; | 778 return it != views_by_token_.end() ? it->second : nullptr; |
769 } | 779 } |
770 | 780 |
771 ViewTreeState* ViewRegistry::FindViewTree(uint32_t view_tree_token_value) { | 781 ViewTreeState* ViewRegistry::FindViewTree(uint32_t view_tree_token_value) { |
772 auto it = view_trees_by_token_.find(view_tree_token_value); | 782 auto it = view_trees_by_token_.find(view_tree_token_value); |
773 return it != view_trees_by_token_.end() ? it->second : nullptr; | 783 return it != view_trees_by_token_.end() ? it->second : nullptr; |
774 } | 784 } |
775 | 785 |
776 } // namespace view_manager | 786 } // namespace view_manager |
OLD | NEW |