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

Unified Diff: services/native_viewport/app_delegate.h

Issue 1309273005: native_viewport support for ozone (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/native_viewport/BUILD.gn ('k') | services/native_viewport/app_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/native_viewport/app_delegate.h
diff --git a/services/native_viewport/app_delegate.h b/services/native_viewport/app_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..9433dc00b446d453d7a6e39ec00622e9d2156d5f
--- /dev/null
+++ b/services/native_viewport/app_delegate.h
@@ -0,0 +1,65 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_
+#define SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_
+
+#include <algorithm>
+
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/macros.h"
+#include "base/message_loop/message_loop.h"
+#include "mojo/application/application_runner_chromium.h"
+#include "mojo/common/tracing_impl.h"
+#include "mojo/public/c/system/main.h"
+#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/application/interface_factory_impl.h"
+#include "mojo/services/native_viewport/public/cpp/args.h"
+#include "services/gles2/gpu_impl.h"
+#include "services/native_viewport/native_viewport_impl.h"
+#include "ui/events/event_switches.h"
+#include "ui/gl/gl_surface.h"
+
+using mojo::ApplicationConnection;
+using mojo::Gpu;
+using mojo::NativeViewport;
+
+namespace native_viewport {
+
+class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
+ public mojo::InterfaceFactory<NativeViewport>,
+ public mojo::InterfaceFactory<Gpu> {
+ public:
+ NativeViewportAppDelegate();
+ ~NativeViewportAppDelegate() override;
+
+ // mojo::ApplicationDelegate implementation.
+ void Initialize(mojo::ApplicationImpl* application) override;
+
+ bool ConfigureIncomingConnection(ApplicationConnection* connection) override;
+
+ // mojo::InterfaceFactory<NativeViewport> implementation.
+ void Create(ApplicationConnection* connection,
+ mojo::InterfaceRequest<NativeViewport> request) override;
+
+ // mojo::InterfaceFactory<Gpu> implementation.
+ void Create(ApplicationConnection* connection,
+ mojo::InterfaceRequest<Gpu> request) override;
+
+ private:
+ void InitLogging(mojo::ApplicationImpl* application);
+
+ mojo::ApplicationImpl* application_;
+ scoped_refptr<gles2::GpuState> gpu_state_;
+ bool is_headless_;
+ mojo::TracingImpl tracing_;
+
+ DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
+};
+
+} // namespace native_viewport
+
+#endif
« no previous file with comments | « services/native_viewport/BUILD.gn ('k') | services/native_viewport/app_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698