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

Side by Side Diff: services/native_viewport/app_delegate.h

Issue 1981513002: ApplicationConnection devolution, part 2.2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « services/native_support/main.cc ('k') | services/native_viewport/app_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_ 5 #ifndef SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_
6 #define SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_ 6 #define SERVICES_NATIVE_VIEWPORT_APP_DELEGATE_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "mojo/application/application_runner_chromium.h" 14 #include "mojo/application/application_runner_chromium.h"
15 #include "mojo/common/tracing_impl.h" 15 #include "mojo/common/tracing_impl.h"
16 #include "mojo/public/c/system/main.h" 16 #include "mojo/public/c/system/main.h"
17 #include "mojo/public/cpp/application/application_delegate.h" 17 #include "mojo/public/cpp/application/application_delegate.h"
18 #include "mojo/public/cpp/application/application_impl.h" 18 #include "mojo/public/cpp/application/application_impl.h"
19 #include "mojo/services/native_viewport/cpp/args.h" 19 #include "mojo/services/native_viewport/cpp/args.h"
20 #include "services/gles2/gpu_impl.h" 20 #include "services/gles2/gpu_impl.h"
21 #include "services/native_viewport/native_viewport_impl.h" 21 #include "services/native_viewport/native_viewport_impl.h"
22 #include "ui/events/event_switches.h" 22 #include "ui/events/event_switches.h"
23 #include "ui/gl/gl_surface.h" 23 #include "ui/gl/gl_surface.h"
24 24
25 namespace native_viewport { 25 namespace native_viewport {
26 26
27 class NativeViewportAppDelegate 27 class NativeViewportAppDelegate : public mojo::ApplicationDelegate {
28 : public mojo::ApplicationDelegate,
29 public mojo::InterfaceFactory<mojo::NativeViewport>,
30 public mojo::InterfaceFactory<mojo::Gpu> {
31 public: 28 public:
32 NativeViewportAppDelegate(); 29 NativeViewportAppDelegate();
33 ~NativeViewportAppDelegate() override; 30 ~NativeViewportAppDelegate() override;
34 31
35 // mojo::ApplicationDelegate implementation. 32 // mojo::ApplicationDelegate implementation.
36 void Initialize(mojo::ApplicationImpl* application) override; 33 void Initialize(mojo::ApplicationImpl* application) override;
37 34
38 bool ConfigureIncomingConnection( 35 bool ConfigureIncomingConnection(
39 mojo::ApplicationConnection* connection) override; 36 mojo::ApplicationConnection* connection) override;
40 37
41 // mojo::InterfaceFactory<mojo::NativeViewport> implementation.
42 void Create(const mojo::ConnectionContext& connection_context,
43 mojo::InterfaceRequest<mojo::NativeViewport> request) override;
44
45 // mojo::InterfaceFactory<mojo::Gpu> implementation.
46 void Create(const mojo::ConnectionContext& connection_context,
47 mojo::InterfaceRequest<mojo::Gpu> request) override;
48
49 private: 38 private:
50 void InitLogging(mojo::ApplicationImpl* application); 39 void InitLogging(mojo::ApplicationImpl* application);
51 40
52 mojo::ApplicationImpl* application_; 41 mojo::ApplicationImpl* application_;
53 scoped_refptr<gles2::GpuState> gpu_state_; 42 scoped_refptr<gles2::GpuState> gpu_state_;
54 bool is_headless_; 43 bool is_headless_;
55 mojo::TracingImpl tracing_; 44 mojo::TracingImpl tracing_;
56 45
57 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate); 46 DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
58 }; 47 };
59 48
60 } // namespace native_viewport 49 } // namespace native_viewport
61 50
62 #endif 51 #endif
OLDNEW
« no previous file with comments | « services/native_support/main.cc ('k') | services/native_viewport/app_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698