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

Side by Side Diff: ui/base/test/scoped_preferred_scroller_style_legacy_mac.mm

Issue 1664523002: Fix FrameOwnerPropertiesPropagationScrolling on 10.6 after r372906 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/base/test/scoped_preferred_scroller_style_legacy_mac.h" 5 #import "ui/base/test/scoped_preferred_scroller_style_legacy_mac.h"
6 6
7 #import "base/mac/sdk_forward_declarations.h" 7 #import "base/mac/sdk_forward_declarations.h"
8 #import "base/mac/scoped_objc_class_swizzler.h" 8 #import "base/mac/scoped_objc_class_swizzler.h"
9 9
10 using base::mac::ScopedObjCClassSwizzler; 10 using base::mac::ScopedObjCClassSwizzler;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 swizzler_.reset( 43 swizzler_.reset(
44 new ScopedObjCClassSwizzler([NSScroller class], 44 new ScopedObjCClassSwizzler([NSScroller class],
45 [FakeNSScrollerPreferredStyleDonor class], 45 [FakeNSScrollerPreferredStyleDonor class],
46 @selector(preferredScrollerStyle))); 46 @selector(preferredScrollerStyle)));
47 47
48 if (previous_style != NSScrollerStyleLegacy) 48 if (previous_style != NSScrollerStyleLegacy)
49 NotifyStyleChanged(); 49 NotifyStyleChanged();
50 } 50 }
51 51
52 ScopedPreferredScrollerStyleLegacy::~ScopedPreferredScrollerStyleLegacy() { 52 ScopedPreferredScrollerStyleLegacy::~ScopedPreferredScrollerStyleLegacy() {
53 if (!swizzler_)
54 return; // Handle 10.6, which wouldn't have swizzled anything.
55
53 swizzler_.reset(); 56 swizzler_.reset();
54 57
55 if ([NSScroller preferredScrollerStyle] != NSScrollerStyleLegacy) 58 if ([NSScroller preferredScrollerStyle] != NSScrollerStyleLegacy)
56 NotifyStyleChanged(); 59 NotifyStyleChanged();
57 } 60 }
58 61
59 } // namespace test 62 } // namespace test
60 } // namespace ui 63 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698