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

Side by Side Diff: components/view_manager/public/cpp/lib/view_manager_init.cc

Issue 1195003002: Mandoline: Introduce ApplicationConnection::CloseConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 5 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 | « no previous file | mandoline/BUILD.gn » ('j') | mandoline/ui/browser/browser.cc » ('J')
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 "components/view_manager/public/cpp/view_manager_init.h" 5 #include "components/view_manager/public/cpp/view_manager_init.h"
6 6
7 #include "components/view_manager/public/cpp/lib/view_manager_client_impl.h" 7 #include "components/view_manager/public/cpp/lib/view_manager_client_impl.h"
8 #include "mojo/application/public/cpp/application_impl.h" 8 #include "mojo/application/public/cpp/application_impl.h"
9 9
10 namespace mojo { 10 namespace mojo {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 connection_->ConnectToService(&view_manager_root_); 43 connection_->ConnectToService(&view_manager_root_);
44 if (root_client) { 44 if (root_client) {
45 root_client_binding_.reset(new Binding<ViewManagerRootClient>(root_client)); 45 root_client_binding_.reset(new Binding<ViewManagerRootClient>(root_client));
46 ViewManagerRootClientPtr root_client_ptr; 46 ViewManagerRootClientPtr root_client_ptr;
47 root_client_binding_->Bind(GetProxy(&root_client_ptr)); 47 root_client_binding_->Bind(GetProxy(&root_client_ptr));
48 view_manager_root_->SetViewManagerRootClient(root_client_ptr.Pass()); 48 view_manager_root_->SetViewManagerRootClient(root_client_ptr.Pass());
49 } 49 }
50 } 50 }
51 51
52 ViewManagerInit::~ViewManagerInit() { 52 ViewManagerInit::~ViewManagerInit() {
53 connection_->CloseConnection();
53 } 54 }
54 55
55 void ViewManagerInit::OnCreate(InterfaceRequest<ViewManagerClient> request) { 56 void ViewManagerInit::OnCreate(InterfaceRequest<ViewManagerClient> request) {
56 // TODO(sky): straighten out lifetime. 57 // TODO(sky): straighten out lifetime.
57 ViewManagerClientImpl* client = new ViewManagerClientImpl( 58 ViewManagerClientImpl* client = new ViewManagerClientImpl(
58 delegate_, app_->shell(), request.Pass()); 59 delegate_, app_->shell(), request.Pass());
59 service_.set_error_handler(nullptr); 60 service_.set_error_handler(nullptr);
60 client->SetViewManagerService(service_.Pass()); 61 client->SetViewManagerService(service_.Pass());
61 } 62 }
62 63
63 void ViewManagerInit::OnConnectionError() { 64 void ViewManagerInit::OnConnectionError() {
64 app_->Terminate(); 65 app_->Terminate();
65 } 66 }
66 67
67 } // namespace mojo 68 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mandoline/BUILD.gn » ('j') | mandoline/ui/browser/browser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698