| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #import "base/test/scoped_class_swizzler_mac.h" |
| 7 #include "ui/events/event_processor.h" | 8 #include "ui/events/event_processor.h" |
| 8 #include "ui/events/event_target.h" | 9 #include "ui/events/event_target.h" |
| 9 #include "ui/events/event_target_iterator.h" | 10 #include "ui/events/event_target_iterator.h" |
| 10 #include "ui/events/event_targeter.h" | 11 #include "ui/events/event_targeter.h" |
| 11 #include "ui/events/test/event_generator.h" | 12 #include "ui/events/test/event_generator.h" |
| 12 #import "ui/events/test/cocoa_test_event_utils.h" | |
| 13 #include "ui/gfx/mac/coordinate_conversion.h" | 13 #include "ui/gfx/mac/coordinate_conversion.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 // Singleton to provide state for swizzled Objective C methods. | 17 // Singleton to provide state for swizzled Objective C methods. |
| 18 ui::test::EventGenerator* g_active_generator = NULL; | 18 ui::test::EventGenerator* g_active_generator = NULL; |
| 19 | 19 |
| 20 } // namespace | 20 } // namespace |
| 21 | 21 |
| 22 @interface NSEventDonor : NSObject | 22 @interface NSEventDonor : NSObject |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 virtual void ConvertPointFromTarget(const ui::EventTarget* target, | 276 virtual void ConvertPointFromTarget(const ui::EventTarget* target, |
| 277 gfx::Point* point) const OVERRIDE {} | 277 gfx::Point* point) const OVERRIDE {} |
| 278 virtual void ConvertPointToTarget(const ui::EventTarget* target, | 278 virtual void ConvertPointToTarget(const ui::EventTarget* target, |
| 279 gfx::Point* point) const OVERRIDE {} | 279 gfx::Point* point) const OVERRIDE {} |
| 280 virtual void ConvertPointFromHost(const ui::EventTarget* hosted_target, | 280 virtual void ConvertPointFromHost(const ui::EventTarget* hosted_target, |
| 281 gfx::Point* point) const OVERRIDE {} | 281 gfx::Point* point) const OVERRIDE {} |
| 282 | 282 |
| 283 private: | 283 private: |
| 284 ui::test::EventGenerator* owner_; | 284 ui::test::EventGenerator* owner_; |
| 285 NSWindow* window_; | 285 NSWindow* window_; |
| 286 ScopedClassSwizzler swizzle_pressed_; | 286 base::ScopedClassSwizzler swizzle_pressed_; |
| 287 | 287 |
| 288 DISALLOW_COPY_AND_ASSIGN(EventGeneratorDelegateMac); | 288 DISALLOW_COPY_AND_ASSIGN(EventGeneratorDelegateMac); |
| 289 }; | 289 }; |
| 290 | 290 |
| 291 EventGeneratorDelegateMac::EventGeneratorDelegateMac( | 291 EventGeneratorDelegateMac::EventGeneratorDelegateMac( |
| 292 ui::test::EventGenerator* owner, NSWindow* window) | 292 ui::test::EventGenerator* owner, NSWindow* window) |
| 293 : owner_(owner), | 293 : owner_(owner), |
| 294 window_(window), | 294 window_(window), |
| 295 swizzle_pressed_([NSEvent class], | 295 swizzle_pressed_([NSEvent class], |
| 296 [NSEventDonor class], | 296 [NSEventDonor class], |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 // static | 332 // static |
| 333 EventGeneratorDelegate* EventGenerator::CreateDefaultPlatformDelegate( | 333 EventGeneratorDelegate* EventGenerator::CreateDefaultPlatformDelegate( |
| 334 EventGenerator* owner, | 334 EventGenerator* owner, |
| 335 gfx::NativeWindow root_window, | 335 gfx::NativeWindow root_window, |
| 336 gfx::NativeWindow window) { | 336 gfx::NativeWindow window) { |
| 337 return new EventGeneratorDelegateMac(owner, window); | 337 return new EventGeneratorDelegateMac(owner, window); |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace test | 340 } // namespace test |
| 341 } // namespace ui | 341 } // namespace ui |
| OLD | NEW |