OLD | NEW |
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 #include "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 public MojoPpapiGlobals::Delegate { | 31 public MojoPpapiGlobals::Delegate { |
32 public: | 32 public: |
33 PepperContainerApp() | 33 PepperContainerApp() |
34 : ppapi_globals_(this), | 34 : ppapi_globals_(this), |
35 plugin_module_(new PluginModule), | 35 plugin_module_(new PluginModule), |
36 weak_factory_(this) {} | 36 weak_factory_(this) {} |
37 | 37 |
38 virtual ~PepperContainerApp() {} | 38 virtual ~PepperContainerApp() {} |
39 | 39 |
40 virtual void Initialize(ApplicationImpl* app) override { | 40 virtual void Initialize(ApplicationImpl* app) override { |
41 app->ConnectToService("mojo:mojo_native_viewport_service", &viewport_); | 41 app->ConnectToService("mojo:native_viewport_service", &viewport_); |
42 viewport_.set_client(this); | 42 viewport_.set_client(this); |
43 | 43 |
44 // TODO(jamesr): Should be mojo:mojo_gpu_service | 44 // TODO(jamesr): Should be mojo:gpu_service |
45 app->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service_); | 45 app->ConnectToService("mojo:native_viewport_service", &gpu_service_); |
46 | 46 |
47 SizePtr size(Size::New()); | 47 SizePtr size(Size::New()); |
48 size->width = 800; | 48 size->width = 800; |
49 size->height = 600; | 49 size->height = 600; |
50 viewport_->Create(size.Pass(), | 50 viewport_->Create(size.Pass(), |
51 base::Bind(&PepperContainerApp::OnCreatedNativeViewport, | 51 base::Bind(&PepperContainerApp::OnCreatedNativeViewport, |
52 weak_factory_.GetWeakPtr())); | 52 weak_factory_.GetWeakPtr())); |
53 viewport_->Show(); | 53 viewport_->Show(); |
54 } | 54 } |
55 | 55 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 } // namespace examples | 122 } // namespace examples |
123 } // namespace mojo | 123 } // namespace mojo |
124 | 124 |
125 MojoResult MojoMain(MojoHandle shell_handle) { | 125 MojoResult MojoMain(MojoHandle shell_handle) { |
126 mojo::ApplicationRunnerChromium runner( | 126 mojo::ApplicationRunnerChromium runner( |
127 new mojo::examples::PepperContainerApp); | 127 new mojo::examples::PepperContainerApp); |
128 return runner.Run(shell_handle); | 128 return runner.Run(shell_handle); |
129 } | 129 } |
130 | 130 |
OLD | NEW |