| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MOJO_SERVICES_NATIVE_VIEWPORT_SERVICE_H_ | 5 #ifndef MOJO_SERVICES_NATIVE_VIEWPORT_SERVICE_H_ |
| 6 #define MOJO_SERVICES_NATIVE_VIEWPORT_SERVICE_H_ | 6 #define MOJO_SERVICES_NATIVE_VIEWPORT_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "mojo/public/bindings/lib/remote_ptr.h" | 9 #include "mojo/public/bindings/lib/remote_ptr.h" |
| 10 #include "mojo/services/native_viewport/native_viewport_export.h" | 10 #include "mojo/services/native_viewport/native_viewport_export.h" |
| 11 #include "mojom/shell.h" | 11 #include "mojom/shell.h" |
| 12 | 12 |
| 13 namespace mojo { | 13 namespace mojo { |
| 14 | 14 |
| 15 namespace shell { | 15 namespace shell { |
| 16 class Context; | 16 class Context; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace services { | 19 namespace services { |
| 20 | 20 |
| 21 class NativeViewportService : public ShellClientStub { | 21 class NativeViewportService : public ShellClient { |
| 22 public: | 22 public: |
| 23 NativeViewportService(ScopedMessagePipeHandle shell_handle); | 23 NativeViewportService(ScopedMessagePipeHandle shell_handle); |
| 24 virtual ~NativeViewportService(); | 24 virtual ~NativeViewportService(); |
| 25 virtual void AcceptConnection(ScopedMessagePipeHandle client_handle) | 25 virtual void AcceptConnection(ScopedMessagePipeHandle client_handle) |
| 26 MOJO_OVERRIDE; | 26 MOJO_OVERRIDE; |
| 27 | 27 |
| 28 // For locally loaded services. | 28 // For locally loaded services. |
| 29 void set_context(shell::Context* context) { context_ = context; } | 29 void set_context(shell::Context* context) { context_ = context; } |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 class NativeViewportImpl; | 32 class NativeViewportImpl; |
| 33 RemotePtr<Shell> shell_; | 33 RemotePtr<Shell> shell_; |
| 34 ScopedVector<NativeViewportImpl> viewports_; | 34 ScopedVector<NativeViewportImpl> viewports_; |
| 35 shell::Context* context_; | 35 shell::Context* context_; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace services | 38 } // namespace services |
| 39 } // namespace mojo | 39 } // namespace mojo |
| 40 | 40 |
| 41 #if defined(OS_ANDROID) | 41 #if defined(OS_ANDROID) |
| 42 MOJO_NATIVE_VIEWPORT_EXPORT mojo::services::NativeViewportService* | 42 MOJO_NATIVE_VIEWPORT_EXPORT mojo::services::NativeViewportService* |
| 43 CreateNativeViewportService(mojo::ScopedMessagePipeHandle shell_handle); | 43 CreateNativeViewportService(mojo::ScopedMessagePipeHandle shell_handle); |
| 44 #endif | 44 #endif |
| 45 | 45 |
| 46 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_SERVICE_H_ | 46 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_SERVICE_H_ |
| OLD | NEW |