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

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

Issue 1991853003: Make BaseView et al. take an ApplicationConnector instead of an ApplicationImpl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh 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
« no previous file with comments | « examples/ui/spinning_cube/spinning_cube_view.cc ('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 "base/strings/string_split.h" 5 #include "base/strings/string_split.h"
6 #include "examples/ui/tile/tile_app.h" 6 #include "examples/ui/tile/tile_app.h"
7 #include "examples/ui/tile/tile_view.h" 7 #include "examples/ui/tile/tile_view.h"
8 #include "mojo/public/cpp/application/connect.h"
8 #include "url/url_parse.h" 9 #include "url/url_parse.h"
9 10
10 namespace examples { 11 namespace examples {
11 12
12 TileApp::TileApp() {} 13 TileApp::TileApp() {}
13 14
14 TileApp::~TileApp() {} 15 TileApp::~TileApp() {}
15 16
16 void TileApp::CreateView( 17 void TileApp::CreateView(
17 const std::string& connection_url, 18 const std::string& connection_url,
18 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, 19 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
19 mojo::InterfaceRequest<mojo::ServiceProvider> services, 20 mojo::InterfaceRequest<mojo::ServiceProvider> services,
20 mojo::InterfaceHandle<mojo::ServiceProvider> exposed_services) { 21 mojo::InterfaceHandle<mojo::ServiceProvider> exposed_services) {
21 TileParams params; 22 TileParams params;
22 if (!ParseParams(connection_url, &params)) { 23 if (!ParseParams(connection_url, &params)) {
23 LOG(ERROR) << "Missing or invalid URL parameters. See README."; 24 LOG(ERROR) << "Missing or invalid URL parameters. See README.";
24 return; 25 return;
25 } 26 }
26 27
27 new TileView(app_impl(), view_owner_request.Pass(), params); 28 new TileView(mojo::CreateApplicationConnector(app_impl()->shell()),
29 view_owner_request.Pass(), params);
28 } 30 }
29 31
30 bool TileApp::ParseParams(const std::string& connection_url, 32 bool TileApp::ParseParams(const std::string& connection_url,
31 TileParams* params) { 33 TileParams* params) {
32 url::Parsed parsed; 34 url::Parsed parsed;
33 url::ParseStandardURL(connection_url.c_str(), connection_url.size(), &parsed); 35 url::ParseStandardURL(connection_url.c_str(), connection_url.size(), &parsed);
34 url::Component query = parsed.query; 36 url::Component query = parsed.query;
35 37
36 for (;;) { 38 for (;;) {
37 url::Component key, value; 39 url::Component key, value;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return false; 71 return false;
70 } else { 72 } else {
71 return false; 73 return false;
72 } 74 }
73 } 75 }
74 76
75 return !params->view_urls.empty(); 77 return !params->view_urls.empty();
76 } 78 }
77 79
78 } // namespace examples 80 } // namespace examples
OLDNEW
« no previous file with comments | « examples/ui/spinning_cube/spinning_cube_view.cc ('k') | examples/ui/tile/tile_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698