summaryrefslogtreecommitdiffstats
path: root/mojo/examples/sample_app
diff options
context:
space:
mode:
authormorrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-24 00:06:23 +0000
committermorrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-24 00:06:23 +0000
commitbb7004b1e0d1295d89610e098489341e279914a9 (patch)
treed07c1ec8d188d02af21945a9e5ec0545d406b443 /mojo/examples/sample_app
parent7b6056468a422425880c2982f6b7f79027ddb131 (diff)
downloadchromium_src-bb7004b1e0d1295d89610e098489341e279914a9.zip
chromium_src-bb7004b1e0d1295d89610e098489341e279914a9.tar.gz
chromium_src-bb7004b1e0d1295d89610e098489341e279914a9.tar.bz2
Mojo: Introduces mojo::EventType and mojo::EventFlags
This change introduces EventType and EventFlags enum types which mirror ui::EventType and ui::EventFlags. With these, simple mouse/touch based Mojo apps no longer have to depend on the ui module. Note that this doesn't introduce any keycodes. It will need some non-trivial work which deserves its own CL. BUG=330467 R=beng@chromium.org, darin@chromium.org, viettrungluu@chromium.org TEST=none Review URL: https://codereview.chromium.org/413633003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285080 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/examples/sample_app')
-rw-r--r--mojo/examples/sample_app/DEPS1
-rw-r--r--mojo/examples/sample_app/gles2_client_impl.cc19
2 files changed, 9 insertions, 11 deletions
diff --git a/mojo/examples/sample_app/DEPS b/mojo/examples/sample_app/DEPS
index d5f25b3..48e8875 100644
--- a/mojo/examples/sample_app/DEPS
+++ b/mojo/examples/sample_app/DEPS
@@ -1,3 +1,2 @@
include_rules = [
- "+ui/events/event_constants.h", # pending enum support in mojom
]
diff --git a/mojo/examples/sample_app/gles2_client_impl.cc b/mojo/examples/sample_app/gles2_client_impl.cc
index d0b0c90..c62b47f 100644
--- a/mojo/examples/sample_app/gles2_client_impl.cc
+++ b/mojo/examples/sample_app/gles2_client_impl.cc
@@ -10,7 +10,6 @@
#include <stdlib.h>
#include "mojo/public/c/gles2/gles2.h"
-#include "ui/events/event_constants.h"
namespace examples {
namespace {
@@ -50,18 +49,18 @@ void GLES2ClientImpl::SetSize(const mojo::Size& size) {
void GLES2ClientImpl::HandleInputEvent(const mojo::Event& event) {
switch (event.action) {
- case ui::ET_MOUSE_PRESSED:
- case ui::ET_TOUCH_PRESSED:
- if (event.flags & ui::EF_RIGHT_MOUSE_BUTTON)
+ case mojo::EVENT_TYPE_MOUSE_PRESSED:
+ case mojo::EVENT_TYPE_TOUCH_PRESSED:
+ if (event.flags & mojo::EVENT_FLAGS_RIGHT_MOUSE_BUTTON)
break;
CancelAnimationFrames();
capture_point_ = *event.location;
last_drag_point_ = capture_point_;
drag_start_time_ = mojo::GetTimeTicksNow();
break;
- case ui::ET_MOUSE_DRAGGED:
- case ui::ET_TOUCH_MOVED:
- if (event.flags & ui::EF_RIGHT_MOUSE_BUTTON)
+ case mojo::EVENT_TYPE_MOUSE_DRAGGED:
+ case mojo::EVENT_TYPE_TOUCH_MOVED:
+ if (event.flags & mojo::EVENT_FLAGS_RIGHT_MOUSE_BUTTON)
break;
if (!getting_animation_frames_) {
int direction = event.location->y < last_drag_point_.y ||
@@ -75,9 +74,9 @@ void GLES2ClientImpl::HandleInputEvent(const mojo::Event& event) {
last_drag_point_ = *event.location;
}
break;
- case ui::ET_MOUSE_RELEASED:
- case ui::ET_TOUCH_RELEASED: {
- if (event.flags & ui::EF_RIGHT_MOUSE_BUTTON) {
+ case mojo::EVENT_TYPE_MOUSE_RELEASED:
+ case mojo::EVENT_TYPE_TOUCH_RELEASED: {
+ if (event.flags & mojo::EVENT_FLAGS_RIGHT_MOUSE_BUTTON) {
cube_.set_color(GetRandomColor(), GetRandomColor(), GetRandomColor());
break;
}