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 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1021 // BridgedNativeWidget, CocoaMouseCaptureDelegate: | 1021 // BridgedNativeWidget, CocoaMouseCaptureDelegate: |
1022 | 1022 |
1023 void BridgedNativeWidget::PostCapturedEvent(NSEvent* event) { | 1023 void BridgedNativeWidget::PostCapturedEvent(NSEvent* event) { |
1024 [bridged_view_ processCapturedMouseEvent:event]; | 1024 [bridged_view_ processCapturedMouseEvent:event]; |
1025 } | 1025 } |
1026 | 1026 |
1027 void BridgedNativeWidget::OnMouseCaptureLost() { | 1027 void BridgedNativeWidget::OnMouseCaptureLost() { |
1028 native_widget_mac_->GetWidget()->OnMouseCaptureLost(); | 1028 native_widget_mac_->GetWidget()->OnMouseCaptureLost(); |
1029 } | 1029 } |
1030 | 1030 |
| 1031 NSWindow* BridgedNativeWidget::GetWindow() const { |
| 1032 return window_; |
| 1033 } |
| 1034 |
1031 //////////////////////////////////////////////////////////////////////////////// | 1035 //////////////////////////////////////////////////////////////////////////////// |
1032 // BridgedNativeWidget, FocusChangeListener: | 1036 // BridgedNativeWidget, FocusChangeListener: |
1033 | 1037 |
1034 void BridgedNativeWidget::OnWillChangeFocus(View* focused_before, | 1038 void BridgedNativeWidget::OnWillChangeFocus(View* focused_before, |
1035 View* focused_now) { | 1039 View* focused_now) { |
1036 } | 1040 } |
1037 | 1041 |
1038 void BridgedNativeWidget::OnDidChangeFocus(View* focused_before, | 1042 void BridgedNativeWidget::OnDidChangeFocus(View* focused_before, |
1039 View* focused_now) { | 1043 View* focused_now) { |
1040 ui::InputMethod* input_method = | 1044 ui::InputMethod* input_method = |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 [bridged_view_ setMouseDownCanMoveWindow:draggable]; | 1357 [bridged_view_ setMouseDownCanMoveWindow:draggable]; |
1354 // AppKit will not update its cache of mouseDownCanMoveWindow unless something | 1358 // AppKit will not update its cache of mouseDownCanMoveWindow unless something |
1355 // changes. Previously we tried adding an NSView and removing it, but for some | 1359 // changes. Previously we tried adding an NSView and removing it, but for some |
1356 // reason it required reposting the mouse-down event, and didn't always work. | 1360 // reason it required reposting the mouse-down event, and didn't always work. |
1357 // Calling the below seems to be an effective solution. | 1361 // Calling the below seems to be an effective solution. |
1358 [window_ setMovableByWindowBackground:NO]; | 1362 [window_ setMovableByWindowBackground:NO]; |
1359 [window_ setMovableByWindowBackground:YES]; | 1363 [window_ setMovableByWindowBackground:YES]; |
1360 } | 1364 } |
1361 | 1365 |
1362 } // namespace views | 1366 } // namespace views |
OLD | NEW |