OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_ |
| 6 #define SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_ |
| 7 |
| 8 #include <algorithm> |
| 9 |
| 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" |
| 12 #include "base/macros.h" |
| 13 #include "base/message_loop/message_loop.h" |
| 14 #include "mojo/application/application_runner_chromium.h" |
| 15 #include "mojo/common/tracing_impl.h" |
| 16 #include "mojo/public/c/system/main.h" |
| 17 #include "mojo/public/cpp/application/application_delegate.h" |
| 18 #include "mojo/public/cpp/application/application_impl.h" |
| 19 #include "mojo/public/cpp/application/interface_factory_impl.h" |
| 20 #include "mojo/services/native_viewport/public/cpp/args.h" |
| 21 #include "services/gles2/gpu_impl.h" |
| 22 #include "services/native_viewport/native_viewport_impl.h" |
| 23 #include "ui/events/event_switches.h" |
| 24 #include "ui/gl/gl_surface.h" |
| 25 |
| 26 using mojo::ApplicationConnection; |
| 27 using mojo::Gpu; |
| 28 using mojo::NativeViewport; |
| 29 |
| 30 namespace native_viewport { |
| 31 |
| 32 class NativeViewportAppDelegate : public mojo::ApplicationDelegate, |
| 33 public mojo::InterfaceFactory<NativeViewport>, |
| 34 public mojo::InterfaceFactory<Gpu> { |
| 35 public: |
| 36 NativeViewportAppDelegate(); |
| 37 ~NativeViewportAppDelegate() override; |
| 38 |
| 39 // mojo::ApplicationDelegate implementation. |
| 40 void Initialize(mojo::ApplicationImpl* application) override; |
| 41 |
| 42 bool ConfigureIncomingConnection(ApplicationConnection* connection) override; |
| 43 |
| 44 // mojo::InterfaceFactory<NativeViewport> implementation. |
| 45 void Create(ApplicationConnection* connection, |
| 46 mojo::InterfaceRequest<NativeViewport> request) override; |
| 47 |
| 48 // mojo::InterfaceFactory<Gpu> implementation. |
| 49 void Create(ApplicationConnection* connection, |
| 50 mojo::InterfaceRequest<Gpu> request) override; |
| 51 |
| 52 private: |
| 53 void InitLogging(mojo::ApplicationImpl* application); |
| 54 |
| 55 mojo::ApplicationImpl* application_; |
| 56 scoped_refptr<gles2::GpuState> gpu_state_; |
| 57 bool is_headless_; |
| 58 mojo::TracingImpl tracing_; |
| 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate); |
| 61 }; |
| 62 |
| 63 } // namespace native_viewport |
| 64 |
| 65 #endif |
OLD | NEW |