Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 2096993002: MacViews: Fix failing mouse capture unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mouse_capture_lifetime
Patch Set: Enable tests. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.h ('k') | ui/views/cocoa/cocoa_mouse_capture.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.h ('k') | ui/views/cocoa/cocoa_mouse_capture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698