| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/tab_view.h" | 5 #import "chrome/browser/cocoa/tab_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/nsimage_cache_mac.h" | 8 #include "base/nsimage_cache_mac.h" |
| 9 #include "chrome/browser/browser_theme_provider.h" | 9 #include "chrome/browser/browser_theme_provider.h" |
| 10 #import "chrome/browser/cocoa/tab_controller.h" | 10 #import "chrome/browser/cocoa/tab_controller.h" |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 if ([controller_ phantom]) | 603 if ([controller_ phantom]) |
| 604 return; | 604 return; |
| 605 | 605 |
| 606 NSGraphicsContext* context = [NSGraphicsContext currentContext]; | 606 NSGraphicsContext* context = [NSGraphicsContext currentContext]; |
| 607 [context saveGraphicsState]; | 607 [context saveGraphicsState]; |
| 608 rect = [self bounds]; | 608 rect = [self bounds]; |
| 609 BOOL active = [[self window] isKeyWindow] || [[self window] isMainWindow]; | 609 BOOL active = [[self window] isKeyWindow] || [[self window] isMainWindow]; |
| 610 BOOL selected = [self state]; | 610 BOOL selected = [self state]; |
| 611 | 611 |
| 612 // Outset by 0.5 in order to draw on pixels rather than on borders (which | 612 // Outset by 0.5 in order to draw on pixels rather than on borders (which |
| 613 // would cause blurry pixels). For non-app tabs, subtract 1px of height to | 613 // would cause blurry pixels). Subtract 1px of height to compensate, otherwise |
| 614 // compensate, otherwise clipping will occur. | 614 // clipping will occur. |
| 615 rect = NSInsetRect(rect, -0.5, -0.5); | 615 rect = NSInsetRect(rect, -0.5, -0.5); |
| 616 if ([controller_ app]) | 616 rect.size.height -= 1.0; |
| 617 rect.size.height = 12.0; | |
| 618 else | |
| 619 rect.size.height -= 1.0; | |
| 620 | 617 |
| 621 NSPoint bottomLeft = NSMakePoint(NSMinX(rect), NSMinY(rect) + 2); | 618 NSPoint bottomLeft = NSMakePoint(NSMinX(rect), NSMinY(rect) + 2); |
| 622 NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect) + 2); | 619 NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect) + 2); |
| 623 NSPoint topRight = | 620 NSPoint topRight = |
| 624 NSMakePoint(NSMaxX(rect) - kInsetMultiplier * NSHeight(rect), | 621 NSMakePoint(NSMaxX(rect) - kInsetMultiplier * NSHeight(rect), |
| 625 NSMaxY(rect)); | 622 NSMaxY(rect)); |
| 626 NSPoint topLeft = | 623 NSPoint topLeft = |
| 627 NSMakePoint(NSMinX(rect) + kInsetMultiplier * NSHeight(rect), | 624 NSMakePoint(NSMinX(rect) + kInsetMultiplier * NSHeight(rect), |
| 628 NSMaxY(rect)); | 625 NSMaxY(rect)); |
| 629 | 626 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 } | 957 } |
| 961 | 958 |
| 962 if (nextUpdate < kNoUpdate) | 959 if (nextUpdate < kNoUpdate) |
| 963 [self performSelector:_cmd withObject:nil afterDelay:nextUpdate]; | 960 [self performSelector:_cmd withObject:nil afterDelay:nextUpdate]; |
| 964 | 961 |
| 965 [self resetLastGlowUpdateTime]; | 962 [self resetLastGlowUpdateTime]; |
| 966 [self setNeedsDisplay:YES]; | 963 [self setNeedsDisplay:YES]; |
| 967 } | 964 } |
| 968 | 965 |
| 969 @end // @implementation TabView(Private) | 966 @end // @implementation TabView(Private) |
| OLD | NEW |