| OLD | NEW |
| 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 "mojo/shell/external_application_listener_posix.h" | 5 #include "mojo/shell/external_application_listener_posix.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 const scoped_refptr<base::SequencedTaskRunner>& shell_runner, | 41 const scoped_refptr<base::SequencedTaskRunner>& shell_runner, |
| 42 const scoped_refptr<base::SequencedTaskRunner>& io_runner) { | 42 const scoped_refptr<base::SequencedTaskRunner>& io_runner) { |
| 43 return make_scoped_ptr( | 43 return make_scoped_ptr( |
| 44 new ExternalApplicationListenerPosix(shell_runner, io_runner)); | 44 new ExternalApplicationListenerPosix(shell_runner, io_runner)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 class ExternalApplicationListenerPosix::RegistrarImpl | 47 class ExternalApplicationListenerPosix::RegistrarImpl |
| 48 : public InterfaceImpl<ExternalApplicationRegistrar> { | 48 : public InterfaceImpl<ExternalApplicationRegistrar> { |
| 49 public: | 49 public: |
| 50 explicit RegistrarImpl(const RegisterCallback& callback); | 50 explicit RegistrarImpl(const RegisterCallback& callback); |
| 51 virtual ~RegistrarImpl() MOJO_OVERRIDE; | 51 virtual ~RegistrarImpl() override; |
| 52 | 52 |
| 53 virtual void OnConnectionError() MOJO_OVERRIDE; | 53 virtual void OnConnectionError() override; |
| 54 | 54 |
| 55 embedder::ChannelInit channel_init; | 55 embedder::ChannelInit channel_init; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 virtual void Register(const String& app_url, | 58 virtual void Register(const String& app_url, |
| 59 InterfaceRequest<Shell> shell, | 59 InterfaceRequest<Shell> shell, |
| 60 const mojo::Closure& callback) MOJO_OVERRIDE; | 60 const mojo::Closure& callback) override; |
| 61 | 61 |
| 62 const RegisterCallback register_callback_; | 62 const RegisterCallback register_callback_; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 ExternalApplicationListenerPosix::ExternalApplicationListenerPosix( | 65 ExternalApplicationListenerPosix::ExternalApplicationListenerPosix( |
| 66 const scoped_refptr<base::SequencedTaskRunner>& shell_runner, | 66 const scoped_refptr<base::SequencedTaskRunner>& shell_runner, |
| 67 const scoped_refptr<base::SequencedTaskRunner>& io_runner) | 67 const scoped_refptr<base::SequencedTaskRunner>& io_runner) |
| 68 : shell_runner_(shell_runner), | 68 : shell_runner_(shell_runner), |
| 69 io_runner_(io_runner), | 69 io_runner_(io_runner), |
| 70 signal_on_listening_(true, false), | 70 signal_on_listening_(true, false), |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void ExternalApplicationListenerPosix::RegistrarImpl::Register( | 192 void ExternalApplicationListenerPosix::RegistrarImpl::Register( |
| 193 const String& app_url, | 193 const String& app_url, |
| 194 InterfaceRequest<Shell> shell, | 194 InterfaceRequest<Shell> shell, |
| 195 const mojo::Closure& callback) { | 195 const mojo::Closure& callback) { |
| 196 register_callback_.Run(app_url.To<GURL>(), shell.PassMessagePipe()); | 196 register_callback_.Run(app_url.To<GURL>(), shell.PassMessagePipe()); |
| 197 callback.Run(); | 197 callback.Run(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace shell | 200 } // namespace shell |
| 201 } // namespace mojo | 201 } // namespace mojo |
| OLD | NEW |