| 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/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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 ui::KeyboardCode key_code, | 198 ui::KeyboardCode key_code, |
| 199 int flags) { | 199 int flags) { |
| 200 // Do not rewrite injected events. See crbug.com/136465. | 200 // Do not rewrite injected events. See crbug.com/136465. |
| 201 flags |= ui::EF_FINAL; | 201 flags |= ui::EF_FINAL; |
| 202 | 202 |
| 203 ui::KeyEvent key_event(type, key_code, flags); | 203 ui::KeyEvent key_event(type, key_code, flags); |
| 204 SendEventToProcessor(&key_event); | 204 SendEventToProcessor(&key_event); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void PostMouseEvent(ui::EventType type, | 207 void PostMouseEvent(ui::EventType type, |
| 208 const gfx::PointF& host_location, | 208 const gfx::Point& host_location, |
| 209 int flags, | 209 int flags, |
| 210 int changed_button_flags) { | 210 int changed_button_flags) { |
| 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::Point& 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(type, host_location, host_location, |
| 222 ui::EventTimeForNow(), flags, | 222 ui::EventTimeForNow(), flags, |
| 223 changed_button_flags); | 223 changed_button_flags); |
| 224 | 224 |
| 225 // This hack is necessary to set the repeat count for clicks. | 225 // This hack is necessary to set the repeat count for clicks. |
| 226 ui::MouseEvent mouse_event2(&mouse_event); | 226 ui::MouseEvent mouse_event2(&mouse_event); |
| 227 | 227 |
| 228 SendEventToProcessor(&mouse_event2); | 228 SendEventToProcessor(&mouse_event2); |
| 229 } | 229 } |
| 230 | 230 |
| 231 WindowTreeHost* host_; | 231 WindowTreeHost* host_; |
| 232 | 232 |
| 233 // Mask of the mouse buttons currently down. | 233 // Mask of the mouse buttons currently down. |
| 234 unsigned button_down_mask_ = 0; | 234 unsigned button_down_mask_ = 0; |
| 235 | 235 |
| 236 DISALLOW_COPY_AND_ASSIGN(UIControlsOzone); | 236 DISALLOW_COPY_AND_ASSIGN(UIControlsOzone); |
| 237 }; | 237 }; |
| 238 | 238 |
| 239 } // namespace | 239 } // namespace |
| 240 | 240 |
| 241 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | 241 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { |
| 242 return new UIControlsOzone(host); | 242 return new UIControlsOzone(host); |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace test | 245 } // namespace test |
| 246 } // namespace aura | 246 } // namespace aura |
| OLD | NEW |