| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "examples/ui/tile/tile_view.h" | 6 #include "examples/ui/tile/tile_view.h" |
| 7 #include "mojo/services/geometry/cpp/geometry_util.h" | 7 #include "mojo/services/geometry/cpp/geometry_util.h" |
| 8 | 8 |
| 9 namespace examples { | 9 namespace examples { |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 ConnectViews(); | 33 ConnectViews(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 TileView::~TileView() {} | 36 TileView::~TileView() {} |
| 37 | 37 |
| 38 void TileView::ConnectViews() { | 38 void TileView::ConnectViews() { |
| 39 uint32_t child_key = 0; | 39 uint32_t child_key = 0; |
| 40 for (const auto& url : params_.view_urls) { | 40 for (const auto& url : params_.view_urls) { |
| 41 // Start connecting to the view provider. | 41 // Start connecting to the view provider. |
| 42 mojo::ui::ViewProviderPtr provider; | 42 mojo::ui::ViewProviderPtr provider; |
| 43 app_impl()->ConnectToService(url, &provider); | 43 app_impl()->ConnectToServiceDeprecated(url, &provider); |
| 44 | 44 |
| 45 LOG(INFO) << "Connecting to view: child_key=" << child_key | 45 LOG(INFO) << "Connecting to view: child_key=" << child_key |
| 46 << ", url=" << url; | 46 << ", url=" << url; |
| 47 mojo::ui::ViewOwnerPtr child_view_owner; | 47 mojo::ui::ViewOwnerPtr child_view_owner; |
| 48 provider->CreateView(mojo::GetProxy(&child_view_owner), nullptr, nullptr); | 48 provider->CreateView(mojo::GetProxy(&child_view_owner), nullptr, nullptr); |
| 49 | 49 |
| 50 GetViewContainer()->AddChild(child_key, child_view_owner.Pass()); | 50 GetViewContainer()->AddChild(child_key, child_view_owner.Pass()); |
| 51 views_.emplace(std::make_pair( | 51 views_.emplace(std::make_pair( |
| 52 child_key, std::unique_ptr<ViewData>(new ViewData(url, child_key)))); | 52 child_key, std::unique_ptr<ViewData>(new ViewData(url, child_key)))); |
| 53 | 53 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 metadata->version = scene_version(); | 252 metadata->version = scene_version(); |
| 253 scene()->Publish(metadata.Pass()); | 253 scene()->Publish(metadata.Pass()); |
| 254 } | 254 } |
| 255 | 255 |
| 256 TileView::ViewData::ViewData(const std::string& url, uint32_t key) | 256 TileView::ViewData::ViewData(const std::string& url, uint32_t key) |
| 257 : url(url), key(key) {} | 257 : url(url), key(key) {} |
| 258 | 258 |
| 259 TileView::ViewData::~ViewData() {} | 259 TileView::ViewData::~ViewData() {} |
| 260 | 260 |
| 261 } // namespace examples | 261 } // namespace examples |
| OLD | NEW |