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

Side by Side Diff: chrome/browser/cocoa/hover_close_button.mm

Issue 2833050: [Mac] Moving some new third party code into its proper dir. Also tweak the ra... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
OLDNEW
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/hover_close_button.h" 5 #import "chrome/browser/cocoa/hover_close_button.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/scoped_nsobject.h" 8 #include "base/scoped_nsobject.h"
9 #import "chrome/browser/cocoa/third_party/NSBezierPath+MCAdditions.h"
10 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #import "third_party/molokocacao/NSBezierPath+MCAdditions.h"
11 11
12 namespace { 12 namespace {
13 // Convenience function to return the middle point of the given |rect|. 13 // Convenience function to return the middle point of the given |rect|.
14 static NSPoint MidRect(NSRect rect) { 14 static NSPoint MidRect(NSRect rect) {
15 return NSMakePoint(NSMidX(rect), NSMidY(rect)); 15 return NSMakePoint(NSMidX(rect), NSMidY(rect));
16 } 16 }
17 17
18 const CGFloat kCircleRadiusPercentage = 0.45; 18 const CGFloat kCircleRadiusPercentage = 0.415;
19 const CGFloat kCircleHoverWhite = 0.565; 19 const CGFloat kCircleHoverWhite = 0.565;
20 const CGFloat kCircleClickWhite = 0.396; 20 const CGFloat kCircleClickWhite = 0.396;
21 const CGFloat kXShadowAlpha = 0.6; 21 const CGFloat kXShadowAlpha = 0.6;
22 const CGFloat kXShadowCircleAlpha = 0.1; 22 const CGFloat kXShadowCircleAlpha = 0.1;
23 } // namespace 23 } // namespace
24 24
25 @interface HoverCloseButton(Private) 25 @interface HoverCloseButton(Private)
26 - (void)setUpDrawingPaths; 26 - (void)setUpDrawingPaths;
27 @end 27 @end
28 28
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 // Update the close buttons if the tab has moved. 176 // Update the close buttons if the tab has moved.
177 NSPoint mouseLoc = [[self window] mouseLocationOutsideOfEventStream]; 177 NSPoint mouseLoc = [[self window] mouseLocationOutsideOfEventStream];
178 mouseLoc = [self convertPoint:mouseLoc fromView:nil]; 178 mouseLoc = [self convertPoint:mouseLoc fromView:nil];
179 hoverState_ = NSPointInRect(mouseLoc, [self bounds]) ? 179 hoverState_ = NSPointInRect(mouseLoc, [self bounds]) ?
180 kHoverStateMouseOver : kHoverStateNone; 180 kHoverStateMouseOver : kHoverStateNone;
181 [self setNeedsDisplay:YES]; 181 [self setNeedsDisplay:YES];
182 } 182 }
183 183
184 @end 184 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698