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

Side by Side Diff: ui/views/widget/native_widget_mac.mm

Issue 2096993002: MacViews: Fix failing mouse capture unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mouse_capture_lifetime
Patch Set: Rebase 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
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 #include "ui/views/widget/native_widget_mac.h" 5 #include "ui/views/widget/native_widget_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/mac/foundation_util.h" 11 #include "base/mac/foundation_util.h"
12 #include "base/mac/scoped_nsobject.h" 12 #include "base/mac/scoped_nsobject.h"
13 #include "base/strings/sys_string_conversions.h" 13 #include "base/strings/sys_string_conversions.h"
14 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h" 14 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h"
15 #import "ui/base/cocoa/window_size_constants.h" 15 #import "ui/base/cocoa/window_size_constants.h"
16 #include "ui/gfx/font_list.h" 16 #include "ui/gfx/font_list.h"
17 #import "ui/gfx/mac/coordinate_conversion.h" 17 #import "ui/gfx/mac/coordinate_conversion.h"
18 #import "ui/gfx/mac/nswindow_frame_controls.h" 18 #import "ui/gfx/mac/nswindow_frame_controls.h"
19 #include "ui/native_theme/native_theme.h" 19 #include "ui/native_theme/native_theme.h"
20 #include "ui/native_theme/native_theme_mac.h" 20 #include "ui/native_theme/native_theme_mac.h"
21 #import "ui/views/cocoa/bridged_content_view.h" 21 #import "ui/views/cocoa/bridged_content_view.h"
22 #import "ui/views/cocoa/bridged_native_widget.h" 22 #import "ui/views/cocoa/bridged_native_widget.h"
23 #include "ui/views/cocoa/cocoa_mouse_capture.h"
23 #import "ui/views/cocoa/drag_drop_client_mac.h" 24 #import "ui/views/cocoa/drag_drop_client_mac.h"
24 #import "ui/views/cocoa/native_widget_mac_nswindow.h" 25 #import "ui/views/cocoa/native_widget_mac_nswindow.h"
25 #import "ui/views/cocoa/views_nswindow_delegate.h" 26 #import "ui/views/cocoa/views_nswindow_delegate.h"
26 #include "ui/views/widget/drop_helper.h" 27 #include "ui/views/widget/drop_helper.h"
27 #include "ui/views/widget/widget_delegate.h" 28 #include "ui/views/widget/widget_delegate.h"
28 #include "ui/views/window/native_frame_view.h" 29 #include "ui/views/window/native_frame_view.h"
29 30
30 // Self-owning animation delegate that starts a hide animation, then calls 31 // Self-owning animation delegate that starts a hide animation, then calls
31 // -[NSWindow close] when the animation ends, releasing itself. 32 // -[NSWindow close] when the animation ends, releasing itself.
32 @interface ViewsNSWindowCloseAnimator : NSObject<NSAnimationDelegate> { 33 @interface ViewsNSWindowCloseAnimator : NSObject<NSAnimationDelegate> {
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 719
719 // static 720 // static
720 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { 721 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() {
721 NOTIMPLEMENTED(); 722 NOTIMPLEMENTED();
722 return gfx::FontList(); 723 return gfx::FontList();
723 } 724 }
724 725
725 // static 726 // static
726 gfx::NativeView NativeWidgetPrivate::GetGlobalCapture( 727 gfx::NativeView NativeWidgetPrivate::GetGlobalCapture(
727 gfx::NativeView native_view) { 728 gfx::NativeView native_view) {
728 NOTIMPLEMENTED(); 729 return [CocoaMouseCapture::GetGlobalCaptureWindow() contentView];
729 return nullptr;
730 } 730 }
731 731
732 } // namespace internal 732 } // namespace internal
733 } // namespace views 733 } // namespace views
734 734
735 @implementation ViewsNSWindowCloseAnimator 735 @implementation ViewsNSWindowCloseAnimator
736 736
737 - (id)initWithWindow:(NSWindow*)window { 737 - (id)initWithWindow:(NSWindow*)window {
738 if ((self = [super init])) { 738 if ((self = [super init])) {
739 window_.reset([window retain]); 739 window_.reset([window retain]);
(...skipping 10 matching lines...) Expand all
750 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; 750 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window];
751 } 751 }
752 752
753 - (void)animationDidEnd:(NSAnimation*)animation { 753 - (void)animationDidEnd:(NSAnimation*)animation {
754 [window_ close]; 754 [window_ close];
755 [animation_ setDelegate:nil]; 755 [animation_ setDelegate:nil];
756 [self release]; 756 [self release];
757 } 757 }
758 758
759 @end 759 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698