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

Side by Side Diff: examples/spinning_cube/spinning_cube_app.cc

Issue 1916233002: Mark ApplicationImpl::ConnectTo{Application,Service}() as deprecated. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <assert.h> 5 #include <assert.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 14 matching lines...) Expand all
25 public mojo::NativeViewportEventDispatcher { 25 public mojo::NativeViewportEventDispatcher {
26 public: 26 public:
27 SpinningCubeApp() : dispatcher_binding_(this) {} 27 SpinningCubeApp() : dispatcher_binding_(this) {}
28 28
29 ~SpinningCubeApp() override { 29 ~SpinningCubeApp() override {
30 // TODO(darin): Fix shutdown so we don't need to leak this. 30 // TODO(darin): Fix shutdown so we don't need to leak this.
31 mojo::ignore_result(gles2_client_.release()); 31 mojo::ignore_result(gles2_client_.release());
32 } 32 }
33 33
34 void Initialize(mojo::ApplicationImpl* app) override { 34 void Initialize(mojo::ApplicationImpl* app) override {
35 app->ConnectToService("mojo:native_viewport_service", &viewport_); 35 app->ConnectToServiceDeprecated("mojo:native_viewport_service", &viewport_);
36 viewport_.set_connection_error_handler( 36 viewport_.set_connection_error_handler(
37 [this]() { OnViewportConnectionError(); }); 37 [this]() { OnViewportConnectionError(); });
38 38
39 SetEventDispatcher(); 39 SetEventDispatcher();
40 40
41 mojo::SizePtr size(mojo::Size::New()); 41 mojo::SizePtr size(mojo::Size::New());
42 size->width = 800; 42 size->width = 800;
43 size->height = 600; 43 size->height = 600;
44 44
45 auto requested_configuration = mojo::SurfaceConfiguration::New(); 45 auto requested_configuration = mojo::SurfaceConfiguration::New();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 MOJO_DISALLOW_COPY_AND_ASSIGN(SpinningCubeApp); 89 MOJO_DISALLOW_COPY_AND_ASSIGN(SpinningCubeApp);
90 }; 90 };
91 91
92 } // namespace examples 92 } // namespace examples
93 93
94 MojoResult MojoMain(MojoHandle application_request) { 94 MojoResult MojoMain(MojoHandle application_request) {
95 mojo::ApplicationRunner runner(std::unique_ptr<examples::SpinningCubeApp>( 95 mojo::ApplicationRunner runner(std::unique_ptr<examples::SpinningCubeApp>(
96 new examples::SpinningCubeApp())); 96 new examples::SpinningCubeApp()));
97 return runner.Run(application_request); 97 return runner.Run(application_request);
98 } 98 }
OLDNEW
« no previous file with comments | « examples/notification_generator/notification_generator.cc ('k') | examples/ui/tile/tile_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698