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

Side by Side Diff: chrome/browser/ui/cocoa/gradient_button_cell.mm

Issue 1988223002: [Mac][Material Design] Bring bookmark hover background up to spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. 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
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_unittest.mm ('k') | 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 (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 #include "chrome/browser/ui/cocoa/gradient_button_cell.h" 5 #include "chrome/browser/ui/cocoa/gradient_button_cell.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #import "base/mac/scoped_nsobject.h" 10 #import "base/mac/scoped_nsobject.h"
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 break; 539 break;
540 } 540 }
541 if (type == kLeftButtonWithShadowType) 541 if (type == kLeftButtonWithShadowType)
542 innerFrame.size.width -= 1.0; 542 innerFrame.size.width -= 1.0;
543 543
544 // Return results if |return...| not null. 544 // Return results if |return...| not null.
545 if (returnInnerFrame) 545 if (returnInnerFrame)
546 *returnInnerFrame = innerFrame; 546 *returnInnerFrame = innerFrame;
547 if (returnInnerPath) { 547 if (returnInnerPath) {
548 DCHECK(*returnInnerPath == nil); 548 DCHECK(*returnInnerPath == nil);
549 // In Material Design on Retina, nudge the hover background by 1px.
550 if ([self tag] == kMaterialStandardButtonTypeWithLimitedClickFeedback &&
551 kLineWidth < 1) {
552 drawFrame.origin.y -= kLineWidth;
553 }
554
549 *returnInnerPath = [NSBezierPath bezierPathWithRoundedRect:drawFrame 555 *returnInnerPath = [NSBezierPath bezierPathWithRoundedRect:drawFrame
550 xRadius:cornerRadius 556 xRadius:cornerRadius
551 yRadius:cornerRadius]; 557 yRadius:cornerRadius];
552 [*returnInnerPath setLineWidth:kLineWidth]; 558 [*returnInnerPath setLineWidth:kLineWidth];
553 } 559 }
554 if (returnClipPath) { 560 if (returnClipPath) {
555 DCHECK(*returnClipPath == nil); 561 DCHECK(*returnClipPath == nil);
556 NSRect clipPathRect = 562 NSRect clipPathRect =
557 NSInsetRect(drawFrame, -kHalfLineWidth, -kHalfLineWidth); 563 NSInsetRect(drawFrame, -kHalfLineWidth, -kHalfLineWidth);
558 *returnClipPath = [NSBezierPath 564 *returnClipPath = [NSBezierPath
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 options:options 834 options:options
829 owner:self 835 owner:self
830 userInfo:nil]); 836 userInfo:nil]);
831 if (isMouseInside_ != mouseInView) { 837 if (isMouseInside_ != mouseInView) {
832 [self setMouseInside:mouseInView animate:NO]; 838 [self setMouseInside:mouseInView animate:NO];
833 [controlView setNeedsDisplay:YES]; 839 [controlView setNeedsDisplay:YES];
834 } 840 }
835 } 841 }
836 842
837 @end 843 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698