| 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_associate_table.h" | 5 #include "services/ui/view_manager/view_associate_table.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 const std::vector<std::string>& urls, | 28 const std::vector<std::string>& urls, |
| 29 const AssociateConnectionErrorCallback& connection_error_callback) { | 29 const AssociateConnectionErrorCallback& connection_error_callback) { |
| 30 DCHECK(app_impl); | 30 DCHECK(app_impl); |
| 31 DCHECK(inspector); | 31 DCHECK(inspector); |
| 32 | 32 |
| 33 for (auto& url : urls) { | 33 for (auto& url : urls) { |
| 34 DVLOG(1) << "Connecting to view associate: url=" << url; | 34 DVLOG(1) << "Connecting to view associate: url=" << url; |
| 35 associates_.emplace_back(new AssociateData(url, inspector)); | 35 associates_.emplace_back(new AssociateData(url, inspector)); |
| 36 AssociateData* data = associates_.back().get(); | 36 AssociateData* data = associates_.back().get(); |
| 37 | 37 |
| 38 app_impl->ConnectToService(url, &data->associate); | 38 app_impl->ConnectToServiceDeprecated(url, &data->associate); |
| 39 data->associate.set_connection_error_handler( | 39 data->associate.set_connection_error_handler( |
| 40 base::Bind(connection_error_callback, url)); | 40 base::Bind(connection_error_callback, url)); |
| 41 | 41 |
| 42 mojo::ui::ViewInspectorPtr inspector; | 42 mojo::ui::ViewInspectorPtr inspector; |
| 43 data->inspector_binding.Bind(mojo::GetProxy(&inspector)); | 43 data->inspector_binding.Bind(mojo::GetProxy(&inspector)); |
| 44 data->associate->Connect( | 44 data->associate->Connect( |
| 45 inspector.Pass(), | 45 inspector.Pass(), |
| 46 base::Bind(&ViewAssociateTable::OnConnected, base::Unretained(this), | 46 base::Bind(&ViewAssociateTable::OnConnected, base::Unretained(this), |
| 47 pending_connection_count_)); | 47 pending_connection_count_)); |
| 48 | 48 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 ViewAssociateTable::AssociateData::AssociateData( | 136 ViewAssociateTable::AssociateData::AssociateData( |
| 137 const std::string& url, | 137 const std::string& url, |
| 138 mojo::ui::ViewInspector* inspector) | 138 mojo::ui::ViewInspector* inspector) |
| 139 : url(url), inspector_binding(inspector) {} | 139 : url(url), inspector_binding(inspector) {} |
| 140 | 140 |
| 141 ViewAssociateTable::AssociateData::~AssociateData() {} | 141 ViewAssociateTable::AssociateData::~AssociateData() {} |
| 142 | 142 |
| 143 } // namespace view_manager | 143 } // namespace view_manager |
| OLD | NEW |