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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "cc/surfaces/surface_id_allocator.h" | 9 #include "cc/surfaces/surface_id_allocator.h" |
10 #include "examples/surfaces_app/child.mojom.h" | 10 #include "examples/surfaces_app/child.mojom.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 Draw(10); | 98 Draw(10); |
99 } | 99 } |
100 | 100 |
101 // SurfaceClient implementation. | 101 // SurfaceClient implementation. |
102 virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override { | 102 virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override { |
103 DCHECK(!resources.size()); | 103 DCHECK(!resources.size()); |
104 } | 104 } |
105 // NativeViewportClient implementation. | 105 // NativeViewportClient implementation. |
106 virtual void OnSizeChanged(mojo::SizePtr size) override {} | 106 virtual void OnSizeChanged(mojo::SizePtr size) override {} |
107 virtual void OnDestroyed() override {} | 107 virtual void OnDestroyed() override {} |
108 virtual void OnEvent(mojo::EventPtr event, | |
109 const mojo::Callback<void()>& callback) override { | |
110 callback.Run(); | |
111 } | |
112 | 108 |
113 private: | 109 private: |
114 void OnCreatedNativeViewport(uint64_t native_viewport_id) {} | 110 void OnCreatedNativeViewport(uint64_t native_viewport_id) {} |
115 | 111 |
116 SurfacesServicePtr surfaces_service_; | 112 SurfacesServicePtr surfaces_service_; |
117 SurfacePtr surface_; | 113 SurfacePtr surface_; |
118 cc::SurfaceId onscreen_id_; | 114 cc::SurfaceId onscreen_id_; |
119 scoped_ptr<cc::SurfaceIdAllocator> allocator_; | 115 scoped_ptr<cc::SurfaceIdAllocator> allocator_; |
120 scoped_ptr<Embedder> embedder_; | 116 scoped_ptr<Embedder> embedder_; |
121 ChildPtr child_one_; | 117 ChildPtr child_one_; |
(...skipping 10 matching lines...) Expand all Loading... |
132 DISALLOW_COPY_AND_ASSIGN(SurfacesApp); | 128 DISALLOW_COPY_AND_ASSIGN(SurfacesApp); |
133 }; | 129 }; |
134 | 130 |
135 } // namespace examples | 131 } // namespace examples |
136 } // namespace mojo | 132 } // namespace mojo |
137 | 133 |
138 MojoResult MojoMain(MojoHandle shell_handle) { | 134 MojoResult MojoMain(MojoHandle shell_handle) { |
139 mojo::ApplicationRunnerChromium runner(new mojo::examples::SurfacesApp); | 135 mojo::ApplicationRunnerChromium runner(new mojo::examples::SurfacesApp); |
140 return runner.Run(shell_handle); | 136 return runner.Run(shell_handle); |
141 } | 137 } |
OLD | NEW |