Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: services/ui/view_manager/view_registry.cc

Issue 1949233002: Create a RegisterViewAssociate method in ViewManager (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: tiny bit more cleanup Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« services/ui/view_manager/view_manager_impl.cc ('K') | « services/ui/view_manager/view_registry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698