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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 } | 751 } |
752 | 752 |
753 void BridgedNativeWidget::OnWindowKeyStatusChangedTo(bool is_key) { | 753 void BridgedNativeWidget::OnWindowKeyStatusChangedTo(bool is_key) { |
754 Widget* widget = native_widget_mac()->GetWidget(); | 754 Widget* widget = native_widget_mac()->GetWidget(); |
755 widget->OnNativeWidgetActivationChanged(is_key); | 755 widget->OnNativeWidgetActivationChanged(is_key); |
756 // The contentView is the BridgedContentView hosting the views::RootView. The | 756 // The contentView is the BridgedContentView hosting the views::RootView. The |
757 // focus manager will already know if a native subview has focus. | 757 // focus manager will already know if a native subview has focus. |
758 if ([window_ contentView] == [window_ firstResponder]) { | 758 if ([window_ contentView] == [window_ firstResponder]) { |
759 if (is_key) { | 759 if (is_key) { |
760 widget->OnNativeFocus(); | 760 widget->OnNativeFocus(); |
| 761 // Explicitly set the keyboard accessibility state on regaining key |
| 762 // window status. |
| 763 [bridged_view_ updateFullKeyboardAccess]; |
761 widget->GetFocusManager()->RestoreFocusedView(); | 764 widget->GetFocusManager()->RestoreFocusedView(); |
762 } else { | 765 } else { |
763 widget->OnNativeBlur(); | 766 widget->OnNativeBlur(); |
764 widget->GetFocusManager()->StoreFocusedView(true); | 767 widget->GetFocusManager()->StoreFocusedView(true); |
765 } | 768 } |
766 } | 769 } |
767 } | 770 } |
768 | 771 |
769 bool BridgedNativeWidget::ShouldRepostPendingLeftMouseDown( | 772 bool BridgedNativeWidget::ShouldRepostPendingLeftMouseDown( |
770 NSPoint location_in_window) { | 773 NSPoint location_in_window) { |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 [bridged_view_ setMouseDownCanMoveWindow:draggable]; | 1241 [bridged_view_ setMouseDownCanMoveWindow:draggable]; |
1239 // AppKit will not update its cache of mouseDownCanMoveWindow unless something | 1242 // AppKit will not update its cache of mouseDownCanMoveWindow unless something |
1240 // changes. Previously we tried adding an NSView and removing it, but for some | 1243 // changes. Previously we tried adding an NSView and removing it, but for some |
1241 // reason it required reposting the mouse-down event, and didn't always work. | 1244 // reason it required reposting the mouse-down event, and didn't always work. |
1242 // Calling the below seems to be an effective solution. | 1245 // Calling the below seems to be an effective solution. |
1243 [window_ setMovableByWindowBackground:NO]; | 1246 [window_ setMovableByWindowBackground:NO]; |
1244 [window_ setMovableByWindowBackground:YES]; | 1247 [window_ setMovableByWindowBackground:YES]; |
1245 } | 1248 } |
1246 | 1249 |
1247 } // namespace views | 1250 } // namespace views |
OLD | NEW |