diff options
Diffstat (limited to 'views/widget/native_widget_views.cc')
-rw-r--r-- | views/widget/native_widget_views.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/views/widget/native_widget_views.cc b/views/widget/native_widget_views.cc index c073b9d..2f1476d 100644 --- a/views/widget/native_widget_views.cc +++ b/views/widget/native_widget_views.cc @@ -160,17 +160,36 @@ void NativeWidgetViews::SendNativeAccessibilityEvent( } void NativeWidgetViews::SetMouseCapture() { + View* parent_root_view = GetParentNativeWidget()->GetWidget()->GetRootView(); + static_cast<internal::RootView*>(parent_root_view)->set_capture_view( + view_.get()); GetParentNativeWidget()->SetMouseCapture(); } void NativeWidgetViews::ReleaseMouseCapture() { + View* parent_root_view = GetParentNativeWidget()->GetWidget()->GetRootView(); + static_cast<internal::RootView*>(parent_root_view)->set_capture_view(NULL); GetParentNativeWidget()->ReleaseMouseCapture(); } bool NativeWidgetViews::HasMouseCapture() const { + // NOTE: we may need to tweak this to only return true if the parent native + // widget's RootView has us as the capture view. return GetParentNativeWidget()->HasMouseCapture(); } +void NativeWidgetViews::SetKeyboardCapture() { + GetParentNativeWidget()->SetKeyboardCapture(); +} + +void NativeWidgetViews::ReleaseKeyboardCapture() { + GetParentNativeWidget()->ReleaseKeyboardCapture(); +} + +bool NativeWidgetViews::HasKeyboardCapture() { + return GetParentNativeWidget()->HasKeyboardCapture(); +} + InputMethod* NativeWidgetViews::GetInputMethodNative() { return GetParentNativeWidget()->GetInputMethodNative(); } |