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 "ui/views/cocoa/bridged_native_widget.h" | 5 #import "ui/views/cocoa/bridged_native_widget.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 } | 792 } |
793 | 793 |
794 void BridgedNativeWidget::OnWindowKeyStatusChangedTo(bool is_key) { | 794 void BridgedNativeWidget::OnWindowKeyStatusChangedTo(bool is_key) { |
795 Widget* widget = native_widget_mac()->GetWidget(); | 795 Widget* widget = native_widget_mac()->GetWidget(); |
796 widget->OnNativeWidgetActivationChanged(is_key); | 796 widget->OnNativeWidgetActivationChanged(is_key); |
797 // The contentView is the BridgedContentView hosting the views::RootView. The | 797 // The contentView is the BridgedContentView hosting the views::RootView. The |
798 // focus manager will already know if a native subview has focus. | 798 // focus manager will already know if a native subview has focus. |
799 if ([window_ contentView] == [window_ firstResponder]) { | 799 if ([window_ contentView] == [window_ firstResponder]) { |
800 if (is_key) { | 800 if (is_key) { |
801 widget->OnNativeFocus(); | 801 widget->OnNativeFocus(); |
| 802 // Explicitly set the keyboard accessibility state on regaining key |
| 803 // window status. |
| 804 [bridged_view_ updateFullKeyboardAccess]; |
802 widget->GetFocusManager()->RestoreFocusedView(); | 805 widget->GetFocusManager()->RestoreFocusedView(); |
803 } else { | 806 } else { |
804 widget->OnNativeBlur(); | 807 widget->OnNativeBlur(); |
805 widget->GetFocusManager()->StoreFocusedView(true); | 808 widget->GetFocusManager()->StoreFocusedView(true); |
806 } | 809 } |
807 } | 810 } |
808 } | 811 } |
809 | 812 |
810 bool BridgedNativeWidget::ShouldRepostPendingLeftMouseDown( | 813 bool BridgedNativeWidget::ShouldRepostPendingLeftMouseDown( |
811 NSPoint location_in_window) { | 814 NSPoint location_in_window) { |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1300 [bridged_view_ setMouseDownCanMoveWindow:draggable]; | 1303 [bridged_view_ setMouseDownCanMoveWindow:draggable]; |
1301 // AppKit will not update its cache of mouseDownCanMoveWindow unless something | 1304 // AppKit will not update its cache of mouseDownCanMoveWindow unless something |
1302 // changes. Previously we tried adding an NSView and removing it, but for some | 1305 // changes. Previously we tried adding an NSView and removing it, but for some |
1303 // reason it required reposting the mouse-down event, and didn't always work. | 1306 // reason it required reposting the mouse-down event, and didn't always work. |
1304 // Calling the below seems to be an effective solution. | 1307 // Calling the below seems to be an effective solution. |
1305 [window_ setMovableByWindowBackground:NO]; | 1308 [window_ setMovableByWindowBackground:NO]; |
1306 [window_ setMovableByWindowBackground:YES]; | 1309 [window_ setMovableByWindowBackground:YES]; |
1307 } | 1310 } |
1308 | 1311 |
1309 } // namespace views | 1312 } // namespace views |
OLD | NEW |