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

Side by Side Diff: mojo/services/native_viewport/main.cc

Issue 477923004: Create native_viewport_service, don't build it into mojo_shell unless Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get the static build to work Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/services/native_viewport/DEPS ('k') | mojo/shell/context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include "base/at_exit.h"
6 #include "base/command_line.h"
7 #include "base/message_loop/message_loop.h"
8 #include "mojo/public/cpp/application/application_connection.h"
9 #include "mojo/public/cpp/application/application_delegate.h"
10 #include "mojo/public/cpp/application/application_impl.h"
11 #include "mojo/services/native_viewport/native_viewport_impl.h"
12 #include "ui/gl/gl_surface.h"
13
14 namespace mojo {
15
16 class NativeViewportAppDelegate : public ApplicationDelegate,
17 public InterfaceFactory<NativeViewport> {
18 public:
19 NativeViewportAppDelegate() {}
20 virtual ~NativeViewportAppDelegate() {}
21
22 virtual bool ConfigureIncomingConnection(
23 ApplicationConnection* connection) OVERRIDE {
24 connection->AddService(this);
25 return true;
26 }
27
28 virtual void Create(ApplicationConnection* connection,
29 InterfaceRequest<NativeViewport> request) OVERRIDE {
30 BindToRequest(new NativeViewportImpl, &request);
Ben Goodger (Google) 2014/08/15 21:59:41 Can you just use a InterfaceFactoryImpl member var
31 }
32 };
33
34 } // namespace mojo
35
36 extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain(
37 MojoHandle shell_handle) {
38 base::CommandLine::Init(0, NULL);
39 #if !defined(COMPONENT_BUILD)
40 base::AtExitManager at_exit;
41 gfx::GLSurface::InitializeOneOff();
42 #endif
43
44 mojo::NativeViewportAppDelegate delegate;
45 {
46 base::MessageLoop loop(base::MessageLoop::TYPE_UI);
47 mojo::ApplicationImpl app(&delegate, shell_handle);
48 loop.Run();
49 }
50 return MOJO_RESULT_OK;
51 }
OLDNEW
« no previous file with comments | « mojo/services/native_viewport/DEPS ('k') | mojo/shell/context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698