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

Side by Side Diff: ui/aura/test/ui_controls_factory_ozone.cc

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 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
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/logging.h" 6 #include "base/logging.h"
7 #include "ui/aura/client/screen_position_client.h" 7 #include "ui/aura/client/screen_position_client.h"
8 #include "ui/aura/env.h" 8 #include "ui/aura/env.h"
9 #include "ui/aura/test/aura_test_utils.h" 9 #include "ui/aura/test/aura_test_utils.h"
10 #include "ui/aura/test/ui_controls_factory_aura.h" 10 #include "ui/aura/test/ui_controls_factory_aura.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 base::MessageLoop::current()->PostTask( 211 base::MessageLoop::current()->PostTask(
212 FROM_HERE, 212 FROM_HERE,
213 base::Bind(&UIControlsOzone::PostMouseEventTask, base::Unretained(this), 213 base::Bind(&UIControlsOzone::PostMouseEventTask, base::Unretained(this),
214 type, host_location, flags, changed_button_flags)); 214 type, host_location, flags, changed_button_flags));
215 } 215 }
216 216
217 void PostMouseEventTask(ui::EventType type, 217 void PostMouseEventTask(ui::EventType type,
218 const gfx::PointF& host_location, 218 const gfx::PointF& host_location,
219 int flags, 219 int flags,
220 int changed_button_flags) { 220 int changed_button_flags) {
221 ui::MouseEvent mouse_event(type, host_location, host_location, 221 ui::MouseEvent mouse_event(
222 ui::EventTimeForNow(), flags, 222 type, host_location, host_location, ui::EventTimeForNow(), flags,
223 changed_button_flags); 223 changed_button_flags,
224 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
224 225
225 // This hack is necessary to set the repeat count for clicks. 226 // This hack is necessary to set the repeat count for clicks.
226 ui::MouseEvent mouse_event2(&mouse_event); 227 ui::MouseEvent mouse_event2(&mouse_event);
227 228
228 SendEventToProcessor(&mouse_event2); 229 SendEventToProcessor(&mouse_event2);
229 } 230 }
230 231
231 WindowTreeHost* host_; 232 WindowTreeHost* host_;
232 233
233 // Mask of the mouse buttons currently down. 234 // Mask of the mouse buttons currently down.
234 unsigned button_down_mask_ = 0; 235 unsigned button_down_mask_ = 0;
235 236
236 DISALLOW_COPY_AND_ASSIGN(UIControlsOzone); 237 DISALLOW_COPY_AND_ASSIGN(UIControlsOzone);
237 }; 238 };
238 239
239 } // namespace 240 } // namespace
240 241
241 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { 242 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) {
242 return new UIControlsOzone(host); 243 return new UIControlsOzone(host);
243 } 244 }
244 245
245 } // namespace test 246 } // namespace test
246 } // namespace aura 247 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698