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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "mojo/examples/pepper_container_app/mojo_ppapi_globals.h" | 10 #include "mojo/examples/pepper_container_app/mojo_ppapi_globals.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 base::MessageLoop::current()->Quit(); | 83 base::MessageLoop::current()->Quit(); |
84 } | 84 } |
85 | 85 |
86 virtual void OnBoundsChanged(const Rect& bounds) OVERRIDE { | 86 virtual void OnBoundsChanged(const Rect& bounds) OVERRIDE { |
87 ppapi::ProxyAutoLock lock; | 87 ppapi::ProxyAutoLock lock; |
88 | 88 |
89 if (plugin_instance_) | 89 if (plugin_instance_) |
90 plugin_instance_->DidChangeView(bounds); | 90 plugin_instance_->DidChangeView(bounds); |
91 } | 91 } |
92 | 92 |
93 virtual void OnEvent(const Event& event) OVERRIDE { | 93 virtual void OnEvent(const Event& event, |
94 if (event.location().is_null()) | 94 const mojo::Callback<void()>& callback) OVERRIDE { |
95 return; | 95 if (!event.location().is_null()) { |
96 | |
97 { | |
98 ppapi::ProxyAutoLock lock; | 96 ppapi::ProxyAutoLock lock; |
99 | 97 |
100 // TODO(yzshen): Handle events. | 98 // TODO(yzshen): Handle events. |
101 } | 99 } |
102 viewport_->AckEvent(event); | 100 callback.Run(); |
103 } | 101 } |
104 | 102 |
105 // MojoPpapiGlobals::Delegate implementation. | 103 // MojoPpapiGlobals::Delegate implementation. |
106 virtual ScopedMessagePipeHandle CreateGLES2Context() OVERRIDE { | 104 virtual ScopedMessagePipeHandle CreateGLES2Context() OVERRIDE { |
107 MessagePipe gles2_pipe; | 105 MessagePipe gles2_pipe; |
108 viewport_->CreateGLES2Context(gles2_pipe.handle1.Pass()); | 106 viewport_->CreateGLES2Context(gles2_pipe.handle1.Pass()); |
109 return gles2_pipe.handle0.Pass(); | 107 return gles2_pipe.handle0.Pass(); |
110 } | 108 } |
111 | 109 |
112 private: | 110 private: |
(...skipping 12 matching lines...) Expand all Loading... |
125 extern "C" PEPPER_CONTAINER_APP_EXPORT MojoResult CDECL MojoMain( | 123 extern "C" PEPPER_CONTAINER_APP_EXPORT MojoResult CDECL MojoMain( |
126 MojoHandle shell_handle) { | 124 MojoHandle shell_handle) { |
127 mojo::Environment env; | 125 mojo::Environment env; |
128 mojo::GLES2Initializer gles2; | 126 mojo::GLES2Initializer gles2; |
129 base::MessageLoop run_loop; | 127 base::MessageLoop run_loop; |
130 mojo::examples::PepperContainerApp app(shell_handle); | 128 mojo::examples::PepperContainerApp app(shell_handle); |
131 | 129 |
132 run_loop.Run(); | 130 run_loop.Run(); |
133 return MOJO_RESULT_OK; | 131 return MOJO_RESULT_OK; |
134 } | 132 } |
OLD | NEW |