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

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

Issue 1138073007: Nukes the windowmanager interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/view_manager/public/cpp/view_manager_init.h"
6
7 #include "components/view_manager/public/cpp/lib/view_manager_client_impl.h"
8 #include "mojo/application/public/cpp/application_impl.h"
9
10 namespace mojo {
11
12 class ViewManagerInit::ClientFactory
13 : public InterfaceFactory<ViewManagerClient> {
14 public:
15 ClientFactory(ViewManagerInit* init) : init_(init) {}
16 ~ClientFactory() override {}
17
18 // InterfaceFactory<ViewManagerClient> implementation.
19 void Create(ApplicationConnection* connection,
20 InterfaceRequest<ViewManagerClient> request) override {
21 init_->OnCreate(request.Pass());
22 }
23
24 private:
25 ViewManagerInit* init_;
26
27 DISALLOW_COPY_AND_ASSIGN(ClientFactory);
28 };
29
30 ViewManagerInit::ViewManagerInit(ApplicationImpl* app,
31 ViewManagerDelegate* delegate,
32 ViewManagerRootClient* root_client)
33 : app_(app), delegate_(delegate), client_factory_(new ClientFactory(this)) {
34 ApplicationConnection* connection =
35 app_->ConnectToApplication("mojo:view_manager");
36 connection->AddService(client_factory_.get());
37 connection->ConnectToService(&service_);
38 connection->ConnectToService(&view_manager_root_);
39 if (root_client) {
40 root_client_binding_.reset(new Binding<ViewManagerRootClient>(root_client));
41 ViewManagerRootClientPtr root_client_ptr;
42 root_client_binding_->Bind(GetProxy(&root_client_ptr));
43 view_manager_root_->SetViewManagerRootClient(root_client_ptr.Pass());
44 }
45 }
46
47 ViewManagerInit::~ViewManagerInit() {
48 }
49
50 void ViewManagerInit::OnCreate(InterfaceRequest<ViewManagerClient> request) {
51 // TODO(sky): straighten out lifetime.
52 const bool delete_on_error = false;
53 ViewManagerClientImpl* client = new ViewManagerClientImpl(
54 delegate_, app_->shell(), request.Pass(), delete_on_error);
55 client->SetViewManagerService(service_.Pass());
56 }
57
58 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698