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

Side by Side Diff: mojo/shell/shell_impl.cc

Issue 1143793003: Remove application-specific args from Mandoline's shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 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 | « mojo/shell/shell_impl.h ('k') | no next file » | 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 "mojo/shell/shell_impl.h" 5 #include "mojo/shell/shell_impl.h"
6 6
7 #include "mojo/common/common_type_converters.h" 7 #include "mojo/common/common_type_converters.h"
8 #include "mojo/common/url_type_converters.h" 8 #include "mojo/common/url_type_converters.h"
9 #include "mojo/shell/application_manager.h" 9 #include "mojo/shell/application_manager.h"
10 #include "third_party/mojo_services/src/content_handler/public/interfaces/conten t_handler.mojom.h" 10 #include "third_party/mojo_services/src/content_handler/public/interfaces/conten t_handler.mojom.h"
11 11
12 namespace mojo { 12 namespace mojo {
13 namespace shell { 13 namespace shell {
14 14
15 ShellImpl::ShellImpl(ApplicationPtr application, 15 ShellImpl::ShellImpl(ApplicationPtr application,
16 ApplicationManager* manager, 16 ApplicationManager* manager,
17 const Identity& identity, 17 const Identity& identity,
18 const base::Closure& on_application_end) 18 const base::Closure& on_application_end)
19 : manager_(manager), 19 : manager_(manager),
20 identity_(identity), 20 identity_(identity),
21 on_application_end_(on_application_end), 21 on_application_end_(on_application_end),
22 application_(application.Pass()), 22 application_(application.Pass()),
23 binding_(this) { 23 binding_(this) {
24 binding_.set_error_handler(this); 24 binding_.set_error_handler(this);
25 } 25 }
26 26
27 ShellImpl::~ShellImpl() { 27 ShellImpl::~ShellImpl() {
28 } 28 }
29 29
30 void ShellImpl::InitializeApplication(Array<String> args) { 30 void ShellImpl::InitializeApplication() {
31 ShellPtr shell; 31 ShellPtr shell;
32 binding_.Bind(GetProxy(&shell)); 32 binding_.Bind(GetProxy(&shell));
33 application_->Initialize(shell.Pass(), args.Pass(), identity_.url.spec()); 33 application_->Initialize(shell.Pass(), identity_.url.spec());
34 } 34 }
35 35
36 void ShellImpl::ConnectToClient(const GURL& requested_url, 36 void ShellImpl::ConnectToClient(const GURL& requested_url,
37 const GURL& requestor_url, 37 const GURL& requestor_url,
38 InterfaceRequest<ServiceProvider> services, 38 InterfaceRequest<ServiceProvider> services,
39 ServiceProviderPtr exposed_services) { 39 ServiceProviderPtr exposed_services) {
40 application_->AcceptConnection(String::From(requestor_url), services.Pass(), 40 application_->AcceptConnection(String::From(requestor_url), services.Pass(),
41 exposed_services.Pass(), requested_url.spec()); 41 exposed_services.Pass(), requested_url.spec());
42 } 42 }
43 43
44 // Shell implementation: 44 // Shell implementation:
45 void ShellImpl::ConnectToApplication(const String& app_url, 45 void ShellImpl::ConnectToApplication(const String& app_url,
46 InterfaceRequest<ServiceProvider> services, 46 InterfaceRequest<ServiceProvider> services,
47 ServiceProviderPtr exposed_services) { 47 ServiceProviderPtr exposed_services) {
48 GURL app_gurl(app_url); 48 GURL app_gurl(app_url);
49 if (!app_gurl.is_valid()) { 49 if (!app_gurl.is_valid()) {
50 LOG(ERROR) << "Error: invalid URL: " << app_url; 50 LOG(ERROR) << "Error: invalid URL: " << app_url;
51 return; 51 return;
52 } 52 }
53 manager_->ConnectToApplication(app_gurl, identity_.url, services.Pass(), 53 manager_->ConnectToApplication(app_gurl, identity_.url, services.Pass(),
54 exposed_services.Pass(), base::Closure()); 54 exposed_services.Pass(), base::Closure());
55 } 55 }
56 56
57 void ShellImpl::OnConnectionError() { 57 void ShellImpl::OnConnectionError() {
58 manager_->OnShellImplError(this); 58 manager_->OnShellImplError(this);
59 } 59 }
60 60
61 } // namespace shell 61 } // namespace shell
62 } // namespace mojo 62 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/shell_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698