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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 1917973002: mac: Remove IsOSLion(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tapted Created 4 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 NSValue* oldTargetValue = [targetFrames_ objectForKey:identifier]; 1124 NSValue* oldTargetValue = [targetFrames_ objectForKey:identifier];
1125 if (!oldTargetValue || 1125 if (!oldTargetValue ||
1126 !NSEqualRects([oldTargetValue rectValue], tabFrame)) { 1126 !NSEqualRects([oldTargetValue rectValue], tabFrame)) {
1127 // Redraw the tab once it moves to its final location. Because we're 1127 // Redraw the tab once it moves to its final location. Because we're
1128 // using Core Animation, each tab caches its contents until told to 1128 // using Core Animation, each tab caches its contents until told to
1129 // redraw. Without forcing a redraw at the end of the move, tabs will 1129 // redraw. Without forcing a redraw at the end of the move, tabs will
1130 // display the wrong content when using a theme that creates transparent 1130 // display the wrong content when using a theme that creates transparent
1131 // tabs. 1131 // tabs.
1132 ScopedNSAnimationContextGroup subAnimationGroup(animate); 1132 ScopedNSAnimationContextGroup subAnimationGroup(animate);
1133 subAnimationGroup.SetCurrentContextDuration(kAnimationDuration); 1133 subAnimationGroup.SetCurrentContextDuration(kAnimationDuration);
1134 // -[NSAnimationContext setCompletionHandler:] is only available on 1134 NSView* tabView = [tab view];
1135 // 10.7 and higher. 1135 [[NSAnimationContext currentContext] setCompletionHandler:^{
1136 if (base::mac::IsOSLionOrLater()) { 1136 [tabView setNeedsDisplay:YES];
1137 NSView* tabView = [tab view]; 1137 }];
1138 [[NSAnimationContext currentContext] setCompletionHandler:^{
1139 [tabView setNeedsDisplay:YES];
1140 }];
1141 }
1142 1138
1143 [frameTarget setFrame:tabFrame]; 1139 [frameTarget setFrame:tabFrame];
1144 [targetFrames_ setObject:[NSValue valueWithRect:tabFrame] 1140 [targetFrames_ setObject:[NSValue valueWithRect:tabFrame]
1145 forKey:identifier]; 1141 forKey:identifier];
1146 } 1142 }
1147 1143
1148 enclosingRect = NSUnionRect(tabFrame, enclosingRect); 1144 enclosingRect = NSUnionRect(tabFrame, enclosingRect);
1149 1145
1150 offset += NSWidth(tabFrame); 1146 offset += NSWidth(tabFrame);
1151 offset -= kTabOverlap; 1147 offset -= kTabOverlap;
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2293 2289
2294 - (TabAlertState)alertStateForContents:(content::WebContents*)contents { 2290 - (TabAlertState)alertStateForContents:(content::WebContents*)contents {
2295 return chrome::GetTabAlertStateForContents(contents); 2291 return chrome::GetTabAlertStateForContents(contents);
2296 } 2292 }
2297 2293
2298 - (void)themeDidChangeNotification:(NSNotification*)notification { 2294 - (void)themeDidChangeNotification:(NSNotification*)notification {
2299 [newTabButton_ setImages]; 2295 [newTabButton_ setImages];
2300 } 2296 }
2301 2297
2302 @end 2298 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/status_bubble_mac.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698