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

Side by Side Diff: examples/ui/tile/tile_app.cc

Issue 1679023006: Reify view ownership as a message pipe. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « examples/ui/tile/tile_app.h ('k') | examples/ui/tile/tile_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
OLDNEW
« no previous file with comments | « examples/ui/tile/tile_app.h ('k') | examples/ui/tile/tile_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698