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

Side by Side Diff: examples/surfaces_app/surfaces_app.cc

Issue 685013002: Refactors event dispatching of NativeViewport into its own interface (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cleanup Created 6 years, 1 month 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 | « examples/sample_app/sample_app.cc ('k') | mojo/services/native_viewport/native_viewport_impl.h » ('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 #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
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
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 }
OLDNEW
« no previous file with comments | « examples/sample_app/sample_app.cc ('k') | mojo/services/native_viewport/native_viewport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698