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

Side by Side Diff: mojo/examples/sample_app/sample_app.cc

Issue 478523002: mojo events: Add |screen_location| to LocationData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix crash observed locally because of synthesized aura events. Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « mojo/examples/sample_app/gles2_client_impl.cc ('k') | mojo/mojo_services.gypi » ('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 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 <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 7
8 #include "mojo/examples/sample_app/gles2_client_impl.h" 8 #include "mojo/examples/sample_app/gles2_client_impl.h"
9 #include "mojo/public/cpp/application/application_connection.h" 9 #include "mojo/public/cpp/application/application_connection.h"
10 #include "mojo/public/cpp/application/application_delegate.h" 10 #include "mojo/public/cpp/application/application_delegate.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 assert(bounds); 56 assert(bounds);
57 mojo::SizePtr size(mojo::Size::New()); 57 mojo::SizePtr size(mojo::Size::New());
58 size->width = bounds->width; 58 size->width = bounds->width;
59 size->height = bounds->height; 59 size->height = bounds->height;
60 gles2_client_->SetSize(*size); 60 gles2_client_->SetSize(*size);
61 } 61 }
62 62
63 virtual void OnEvent(mojo::EventPtr event, 63 virtual void OnEvent(mojo::EventPtr event,
64 const mojo::Callback<void()>& callback) MOJO_OVERRIDE { 64 const mojo::Callback<void()>& callback) MOJO_OVERRIDE {
65 assert(event); 65 assert(event);
66 if (event->location) 66 if (event->location_data && event->location_data->in_view_location)
67 gles2_client_->HandleInputEvent(*event); 67 gles2_client_->HandleInputEvent(*event);
68 callback.Run(); 68 callback.Run();
69 } 69 }
70 70
71 private: 71 private:
72 scoped_ptr<GLES2ClientImpl> gles2_client_; 72 scoped_ptr<GLES2ClientImpl> gles2_client_;
73 mojo::NativeViewportPtr viewport_; 73 mojo::NativeViewportPtr viewport_;
74 74
75 DISALLOW_COPY_AND_ASSIGN(SampleApp); 75 DISALLOW_COPY_AND_ASSIGN(SampleApp);
76 }; 76 };
77 77
78 } // namespace examples 78 } // namespace examples
79 79
80 namespace mojo { 80 namespace mojo {
81 81
82 // static 82 // static
83 ApplicationDelegate* ApplicationDelegate::Create() { 83 ApplicationDelegate* ApplicationDelegate::Create() {
84 return new examples::SampleApp(); 84 return new examples::SampleApp();
85 } 85 }
86 86
87 } // namespace mojo 87 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/sample_app/gles2_client_impl.cc ('k') | mojo/mojo_services.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698