| OLD | NEW |
| 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/location.h" | 6 #include "base/location.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 base::ThreadTaskRunnerHandle::Get()->PostTask( | 210 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 211 FROM_HERE, | 211 FROM_HERE, |
| 212 base::Bind(&UIControlsOzone::PostMouseEventTask, base::Unretained(this), | 212 base::Bind(&UIControlsOzone::PostMouseEventTask, base::Unretained(this), |
| 213 type, host_location, flags, changed_button_flags)); | 213 type, host_location, flags, changed_button_flags)); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void PostMouseEventTask(ui::EventType type, | 216 void PostMouseEventTask(ui::EventType type, |
| 217 const gfx::Point& host_location, | 217 const gfx::Point& host_location, |
| 218 int flags, | 218 int flags, |
| 219 int changed_button_flags) { | 219 int changed_button_flags) { |
| 220 ui::MouseEvent mouse_event(type, host_location, host_location, | 220 ui::MouseEvent mouse_event( |
| 221 ui::EventTimeForNow(), flags, | 221 type, host_location, host_location, ui::EventTimeForNow(), flags, |
| 222 changed_button_flags); | 222 changed_button_flags, |
| 223 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)); |
| 223 | 224 |
| 224 // This hack is necessary to set the repeat count for clicks. | 225 // This hack is necessary to set the repeat count for clicks. |
| 225 ui::MouseEvent mouse_event2(&mouse_event); | 226 ui::MouseEvent mouse_event2(&mouse_event); |
| 226 | 227 |
| 227 SendEventToSink(&mouse_event2); | 228 SendEventToSink(&mouse_event2); |
| 228 } | 229 } |
| 229 | 230 |
| 230 WindowTreeHost* host_; | 231 WindowTreeHost* host_; |
| 231 | 232 |
| 232 // Mask of the mouse buttons currently down. | 233 // Mask of the mouse buttons currently down. |
| 233 unsigned button_down_mask_ = 0; | 234 unsigned button_down_mask_ = 0; |
| 234 | 235 |
| 235 DISALLOW_COPY_AND_ASSIGN(UIControlsOzone); | 236 DISALLOW_COPY_AND_ASSIGN(UIControlsOzone); |
| 236 }; | 237 }; |
| 237 | 238 |
| 238 } // namespace | 239 } // namespace |
| 239 | 240 |
| 240 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | 241 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { |
| 241 return new UIControlsOzone(host); | 242 return new UIControlsOzone(host); |
| 242 } | 243 } |
| 243 | 244 |
| 244 } // namespace test | 245 } // namespace test |
| 245 } // namespace aura | 246 } // namespace aura |
| OLD | NEW |