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

Side by Side Diff: trunk/src/mojo/dbus/dbus_external_service.h

Issue 304593002: Revert 272983 "Change Shell / ShellClient to ServiceProvider" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « trunk/src/mojo/apps/js/main.js ('k') | trunk/src/mojo/dbus/dbus_external_service.cc » ('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 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "dbus/bus.h" 6 #include "dbus/bus.h"
7 #include "dbus/exported_object.h" 7 #include "dbus/exported_object.h"
8 #include "dbus/message.h" 8 #include "dbus/message.h"
9 #include "dbus/object_path.h" 9 #include "dbus/object_path.h"
10 #include "mojo/common/channel_init.h" 10 #include "mojo/common/channel_init.h"
11 #include "mojo/public/cpp/application/application.h" 11 #include "mojo/public/cpp/shell/application.h"
12 #include "mojo/public/interfaces/service_provider/service_provider.mojom.h" 12 #include "mojo/public/interfaces/shell/shell.mojom.h"
13 #include "mojo/shell/external_service.mojom.h" 13 #include "mojo/shell/external_service.mojom.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 const char kMojoDBusImplPath[] = "/org/chromium/MojoImpl"; 16 const char kMojoDBusImplPath[] = "/org/chromium/MojoImpl";
17 const char kMojoDBusInterface[] = "org.chromium.Mojo"; 17 const char kMojoDBusInterface[] = "org.chromium.Mojo";
18 const char kMojoDBusConnectMethod[] = "ConnectChannel"; 18 const char kMojoDBusConnectMethod[] = "ConnectChannel";
19 19
20 class DBusExternalServiceBase { 20 class DBusExternalServiceBase {
21 public: 21 public:
22 explicit DBusExternalServiceBase(const std::string& service_name); 22 explicit DBusExternalServiceBase(const std::string& service_name);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 private: 67 private:
68 class Impl : public InterfaceImpl<ExternalService> { 68 class Impl : public InterfaceImpl<ExternalService> {
69 public: 69 public:
70 explicit Impl(DBusExternalService* service) : service_(service) { 70 explicit Impl(DBusExternalService* service) : service_(service) {
71 } 71 }
72 virtual void OnConnectionError() OVERRIDE { 72 virtual void OnConnectionError() OVERRIDE {
73 service_->Disconnect(); 73 service_->Disconnect();
74 } 74 }
75 virtual void Activate(ScopedMessagePipeHandle service_provider_handle) 75 virtual void Activate(ScopedMessagePipeHandle shell_handle) OVERRIDE {
76 OVERRIDE { 76 app_.reset(new Application(shell_handle.Pass()));
77 app_.reset(new Application(service_provider_handle.Pass()));
78 app_->AddService<ServiceImpl>(); 77 app_->AddService<ServiceImpl>();
79 } 78 }
80 private: 79 private:
81 DBusExternalService* service_; 80 DBusExternalService* service_;
82 scoped_ptr<Application> app_; 81 scoped_ptr<Application> app_;
83 }; 82 };
84 83
85 scoped_ptr<Impl> external_service_; 84 scoped_ptr<Impl> external_service_;
86 }; 85 };
87 86
88 } // namespace mojo 87 } // namespace mojo
OLDNEW
« no previous file with comments | « trunk/src/mojo/apps/js/main.js ('k') | trunk/src/mojo/dbus/dbus_external_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698