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 #ifndef CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ | 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
6 #define CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ | 6 #define CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
7 | 7 |
8 #include "base/process/process_handle.h" | 8 #include "base/process/process_handle.h" |
9 #include "mojo/common/channel_init.h" | 9 #include "mojo/common/channel_init.h" |
10 #include "mojo/embedder/scoped_platform_handle.h" | 10 #include "mojo/embedder/scoped_platform_handle.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 bool did_activate() const { return did_activate_; } | 35 bool did_activate() const { return did_activate_; } |
36 | 36 |
37 mojo::ShellClient* shell_client() { | 37 mojo::ShellClient* shell_client() { |
38 DCHECK(shell_.get()); | 38 DCHECK(shell_.get()); |
39 return shell_->client(); | 39 return shell_->client(); |
40 } | 40 } |
41 | 41 |
42 private: | 42 private: |
43 class ShellImpl : public mojo::InterfaceImpl<mojo::Shell> { | 43 class ShellImpl : public mojo::InterfaceImpl<mojo::Shell> { |
44 public: | 44 public: |
45 ShellImpl() : client_(NULL) {} | |
46 mojo::ShellClient* client() { return client_; } | |
47 | |
48 virtual void OnConnectionError() OVERRIDE { | 45 virtual void OnConnectionError() OVERRIDE { |
49 // TODO(darin): How should we handle this error? | 46 // TODO(darin): How should we handle this error? |
50 } | 47 } |
51 | 48 |
52 // mojo::Shell methods: | 49 // mojo::Shell methods: |
53 virtual void SetClient(mojo::ShellClient* client) OVERRIDE; | |
54 virtual void Connect(const mojo::String& url, | 50 virtual void Connect(const mojo::String& url, |
55 mojo::ScopedMessagePipeHandle handle) OVERRIDE; | 51 mojo::ScopedMessagePipeHandle handle) OVERRIDE; |
56 private: | |
57 mojo::ShellClient* client_; | |
58 }; | 52 }; |
59 | 53 |
60 mojo::common::ChannelInit channel_init_; | 54 mojo::common::ChannelInit channel_init_; |
61 mojo::embedder::ScopedPlatformHandle client_handle_; | 55 mojo::embedder::ScopedPlatformHandle client_handle_; |
62 | 56 |
63 scoped_ptr<ShellImpl> shell_; | 57 scoped_ptr<ShellImpl> shell_; |
64 | 58 |
65 bool did_activate_; | 59 bool did_activate_; |
66 | 60 |
67 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost); | 61 DISALLOW_COPY_AND_ASSIGN(MojoApplicationHost); |
68 }; | 62 }; |
69 | 63 |
70 } // namespace content | 64 } // namespace content |
71 | 65 |
72 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ | 66 #endif // CONTENT_BROWSER_MOJO_MOJO_APPLICATION_HOST_H_ |
OLD | NEW |