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

Side by Side Diff: ui/events/ozone/evdev/event_converter_evdev_impl.cc

Issue 761843003: ozone: dri: Rename DriCursor::location() to GetLocation() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 6 years 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 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 "ui/events/ozone/evdev/event_converter_evdev_impl.h" 5 #include "ui/events/ozone/evdev/event_converter_evdev_impl.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <linux/input.h> 8 #include <linux/input.h>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 modifier = EVDEV_MODIFIER_RIGHT_MOUSE_BUTTON; 104 modifier = EVDEV_MODIFIER_RIGHT_MOUSE_BUTTON;
105 else if (input.code == BTN_MIDDLE) 105 else if (input.code == BTN_MIDDLE)
106 modifier = EVDEV_MODIFIER_MIDDLE_MOUSE_BUTTON; 106 modifier = EVDEV_MODIFIER_MIDDLE_MOUSE_BUTTON;
107 else 107 else
108 return; 108 return;
109 109
110 int flag = modifiers_->GetEventFlagFromModifier(modifier); 110 int flag = modifiers_->GetEventFlagFromModifier(modifier);
111 modifiers_->UpdateModifier(modifier, input.value); 111 modifiers_->UpdateModifier(modifier, input.value);
112 callback_.Run(make_scoped_ptr( 112 callback_.Run(make_scoped_ptr(
113 new MouseEvent(input.value ? ET_MOUSE_PRESSED : ET_MOUSE_RELEASED, 113 new MouseEvent(input.value ? ET_MOUSE_PRESSED : ET_MOUSE_RELEASED,
114 cursor_->location(), 114 cursor_->GetLocation(),
115 cursor_->location(), 115 cursor_->GetLocation(),
116 modifiers_->GetModifierFlags() | flag, 116 modifiers_->GetModifierFlags() | flag,
117 flag))); 117 flag)));
118 } 118 }
119 119
120 void EventConverterEvdevImpl::FlushEvents() { 120 void EventConverterEvdevImpl::FlushEvents() {
121 if (!cursor_ || (x_offset_ == 0 && y_offset_ == 0)) 121 if (!cursor_ || (x_offset_ == 0 && y_offset_ == 0))
122 return; 122 return;
123 123
124 cursor_->MoveCursor(gfx::Vector2dF(x_offset_, y_offset_)); 124 cursor_->MoveCursor(gfx::Vector2dF(x_offset_, y_offset_));
125 125
126 callback_.Run(make_scoped_ptr( 126 callback_.Run(make_scoped_ptr(
127 new MouseEvent(ui::ET_MOUSE_MOVED, 127 new MouseEvent(ui::ET_MOUSE_MOVED,
128 cursor_->location(), 128 cursor_->GetLocation(),
129 cursor_->location(), 129 cursor_->GetLocation(),
130 modifiers_->GetModifierFlags(), 130 modifiers_->GetModifierFlags(),
131 /* changed_button_flags */ 0))); 131 /* changed_button_flags */ 0)));
132 x_offset_ = 0; 132 x_offset_ = 0;
133 y_offset_ = 0; 133 y_offset_ = 0;
134 } 134 }
135 135
136 } // namespace ui 136 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/cursor_delegate_evdev.h ('k') | ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698