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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
8 #include "examples/ui/tile/tile_app.h" | 8 #include "examples/ui/tile/tile_app.h" |
9 #include "examples/ui/tile/tile_view.h" | 9 #include "examples/ui/tile/tile_view.h" |
10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
11 | 11 |
12 namespace examples { | 12 namespace examples { |
13 | 13 |
14 TileApp::TileApp() {} | 14 TileApp::TileApp() {} |
15 | 15 |
16 TileApp::~TileApp() {} | 16 TileApp::~TileApp() {} |
17 | 17 |
18 bool TileApp::CreateView( | 18 void TileApp::CreateView( |
19 const std::string& connection_url, | 19 const std::string& connection_url, |
| 20 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, |
20 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 21 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
21 mojo::ServiceProviderPtr exposed_services, | 22 mojo::ServiceProviderPtr exposed_services) { |
22 const mojo::ui::ViewProvider::CreateViewCallback& callback) { | |
23 GURL url(connection_url); | 23 GURL url(connection_url); |
24 std::vector<std::string> view_urls; | 24 std::vector<std::string> view_urls; |
25 base::SplitString(url.query(), ',', &view_urls); | 25 base::SplitString(url.query(), ',', &view_urls); |
26 | 26 |
27 if (view_urls.empty()) { | 27 if (view_urls.empty()) { |
28 LOG(ERROR) << "Must supply comma-delimited URLs of mojo views to tile as a " | 28 LOG(ERROR) << "Must supply comma-delimited URLs of mojo views to tile as a " |
29 "query parameter."; | 29 "query parameter."; |
30 return false; | 30 return; |
31 } | 31 } |
32 | 32 |
33 new TileView(app_impl(), view_urls, callback); | 33 new TileView(app_impl(), view_owner_request.Pass(), view_urls); |
34 return true; | |
35 } | 34 } |
36 | 35 |
37 } // namespace examples | 36 } // namespace examples |
OLD | NEW |