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

Side by Side Diff: services/view_manager/view_manager_app.cc

Issue 905083002: Adds Embed() variant to ViewManagerService that takes ViewManagerClient (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: real comments Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/view_manager/view_manager_app.h" 5 #include "services/view_manager/view_manager_app.h"
6 6
7 #include "mojo/application/application_runner_chromium.h" 7 #include "mojo/application/application_runner_chromium.h"
8 #include "mojo/common/tracing_impl.h" 8 #include "mojo/common/tracing_impl.h"
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 const ViewId& root_id) { 65 const ViewId& root_id) {
66 mojo::ViewManagerClientPtr client; 66 mojo::ViewManagerClientPtr client;
67 wm_app_connection_->ConnectToApplication(url)->ConnectToService(&client); 67 wm_app_connection_->ConnectToApplication(url)->ConnectToService(&client);
68 68
69 scoped_ptr<ViewManagerServiceImpl> service(new ViewManagerServiceImpl( 69 scoped_ptr<ViewManagerServiceImpl> service(new ViewManagerServiceImpl(
70 connection_manager, creator_id, creator_url, url, root_id)); 70 connection_manager, creator_id, creator_url, url, root_id));
71 return new DefaultClientConnection(service.Pass(), connection_manager, 71 return new DefaultClientConnection(service.Pass(), connection_manager,
72 service_request.Pass(), client.Pass()); 72 service_request.Pass(), client.Pass());
73 } 73 }
74 74
75 ClientConnection* ViewManagerApp::CreateClientConnectionForEmbedAtView(
76 ConnectionManager* connection_manager,
77 mojo::InterfaceRequest<mojo::ViewManagerService> service_request,
78 mojo::ConnectionSpecificId creator_id,
79 const std::string& creator_url,
80 const ViewId& root_id,
81 mojo::ViewManagerClientPtr view_manager_client) {
82 scoped_ptr<ViewManagerServiceImpl> service(new ViewManagerServiceImpl(
83 connection_manager, creator_id, creator_url, std::string(), root_id));
84 return new DefaultClientConnection(service.Pass(), connection_manager,
85 service_request.Pass(),
86 view_manager_client.Pass());
87 }
88
75 void ViewManagerApp::Create(ApplicationConnection* connection, 89 void ViewManagerApp::Create(ApplicationConnection* connection,
76 InterfaceRequest<ViewManagerService> request) { 90 InterfaceRequest<ViewManagerService> request) {
77 if (connection_manager_->has_window_manager_client_connection()) { 91 if (connection_manager_->has_window_manager_client_connection()) {
78 VLOG(1) << "ViewManager interface requested more than once."; 92 VLOG(1) << "ViewManager interface requested more than once.";
79 return; 93 return;
80 } 94 }
81 95
82 scoped_ptr<ViewManagerServiceImpl> service(new ViewManagerServiceImpl( 96 scoped_ptr<ViewManagerServiceImpl> service(new ViewManagerServiceImpl(
83 connection_manager_.get(), kInvalidConnectionId, std::string(), 97 connection_manager_.get(), kInvalidConnectionId, std::string(),
84 std::string("mojo:window_manager"), RootViewId())); 98 std::string("mojo:window_manager"), RootViewId()));
(...skipping 22 matching lines...) Expand all
107 wm_internal_client_binding_->set_error_handler(this); 121 wm_internal_client_binding_->set_error_handler(this);
108 wm_internal_->SetViewManagerClient( 122 wm_internal_->SetViewManagerClient(
109 wm_internal_client_request_.PassMessagePipe()); 123 wm_internal_client_request_.PassMessagePipe());
110 } 124 }
111 125
112 void ViewManagerApp::OnConnectionError() { 126 void ViewManagerApp::OnConnectionError() {
113 ApplicationImpl::Terminate(); 127 ApplicationImpl::Terminate();
114 } 128 }
115 129
116 } // namespace view_manager 130 } // namespace view_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698