| Index: ui/views/cocoa/bridged_native_widget.h
|
| diff --git a/ui/views/cocoa/bridged_native_widget.h b/ui/views/cocoa/bridged_native_widget.h
|
| index 5f495f8982fe368bae4da308e08360b71bcee349..adb232cd1406583e88e9a0ab30d3508906e26fba 100644
|
| --- a/ui/views/cocoa/bridged_native_widget.h
|
| +++ b/ui/views/cocoa/bridged_native_widget.h
|
| @@ -12,6 +12,7 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "ui/compositor/layer_owner.h"
|
| #import "ui/accelerated_widget_mac/accelerated_widget_mac.h"
|
| +#import "ui/views/cocoa/cocoa_mouse_capture_delegate.h"
|
| #import "ui/views/focus/focus_manager.h"
|
| #include "ui/views/ime/input_method_delegate.h"
|
| #include "ui/views/views_export.h"
|
| @@ -26,6 +27,7 @@ class InputMethod;
|
|
|
| namespace views {
|
|
|
| +class CocoaMouseCapture;
|
| class InputMethod;
|
| class NativeWidgetMac;
|
| class View;
|
| @@ -36,6 +38,7 @@ class View;
|
| class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
|
| public ui::LayerOwner,
|
| public internal::InputMethodDelegate,
|
| + public CocoaMouseCaptureDelegate,
|
| public FocusChangeListener,
|
| public ui::AcceleratedWidgetMacNSView {
|
| public:
|
| @@ -70,6 +73,12 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
|
| // descendant windows where necessary.
|
| void SetVisibilityState(WindowVisibilityState new_state);
|
|
|
| + // Acquiring mouse capture first steals capture from any existing
|
| + // CocoaMouseCaptureDelegate, then captures all mouse events until released.
|
| + void AcquireCapture();
|
| + void ReleaseCapture();
|
| + bool HasCapture();
|
| +
|
| // Called internally by the NSWindowDelegate when the window is closing.
|
| void OnWindowWillClose();
|
|
|
| @@ -158,6 +167,10 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
|
| // scale factor.
|
| void UpdateLayerProperties();
|
|
|
| + // Overridden from CocoaMouseCaptureDelegate:
|
| + void PostCapturedEvent(NSEvent* event) override;
|
| + void OnMouseCaptureLost() override;
|
| +
|
| // Overridden from FocusChangeListener:
|
| void OnWillChangeFocus(View* focused_before,
|
| View* focused_now) override;
|
| @@ -182,6 +195,7 @@ class VIEWS_EXPORT BridgedNativeWidget : public ui::LayerDelegate,
|
| base::scoped_nsobject<ViewsNSWindowDelegate> window_delegate_;
|
| base::scoped_nsobject<BridgedContentView> bridged_view_;
|
| scoped_ptr<ui::InputMethod> input_method_;
|
| + scoped_ptr<CocoaMouseCapture> mouse_capture_;
|
| FocusManager* focus_manager_; // Weak. Owned by our Widget.
|
|
|
| BridgedNativeWidget* parent_; // Weak. If non-null, owns this.
|
|
|