| 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 #ifndef UI_VIEWS_COCOA_COCOA_MOUSE_CAPTURE_DELEGATE_H_ | 5 #ifndef UI_VIEWS_COCOA_COCOA_MOUSE_CAPTURE_DELEGATE_H_ |
| 6 #define UI_VIEWS_COCOA_COCOA_MOUSE_CAPTURE_DELEGATE_H_ | 6 #define UI_VIEWS_COCOA_COCOA_MOUSE_CAPTURE_DELEGATE_H_ |
| 7 | 7 |
| 8 @class NSEvent; | 8 @class NSEvent; |
| 9 @class NSWindow; |
| 9 | 10 |
| 10 namespace views { | 11 namespace views { |
| 11 | 12 |
| 12 // Delegate for receiving captured events from a CocoaMouseCapture. | 13 // Delegate for receiving captured events from a CocoaMouseCapture. |
| 13 class CocoaMouseCaptureDelegate { | 14 class CocoaMouseCaptureDelegate { |
| 14 public: | 15 public: |
| 15 // Called when an event has been captured. This may be an event local to the | 16 // Called when an event has been captured. This may be an event local to the |
| 16 // application, or a global event (sent to another application). If it is a | 17 // application, or a global event (sent to another application). If it is a |
| 17 // local event, regular event handling will be suppressed. | 18 // local event, regular event handling will be suppressed. |
| 18 virtual void PostCapturedEvent(NSEvent* event) = 0; | 19 virtual void PostCapturedEvent(NSEvent* event) = 0; |
| 19 | 20 |
| 20 // Called once. When another window acquires capture, or when the | 21 // Called once. When another window acquires capture, or when the |
| 21 // CocoaMouseCapture is destroyed. | 22 // CocoaMouseCapture is destroyed. |
| 22 virtual void OnMouseCaptureLost() = 0; | 23 virtual void OnMouseCaptureLost() = 0; |
| 24 |
| 25 // Returns the associated NSWindow. |
| 26 virtual NSWindow* GetWindow() const = 0; |
| 23 }; | 27 }; |
| 24 | 28 |
| 25 } // namespace views | 29 } // namespace views |
| 26 | 30 |
| 27 #endif // UI_VIEWS_COCOA_COCOA_MOUSE_CAPTURE_DELEGATE_H_ | 31 #endif // UI_VIEWS_COCOA_COCOA_MOUSE_CAPTURE_DELEGATE_H_ |
| OLD | NEW |