OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/info_bubble_view.h" | 5 #import "chrome/browser/cocoa/info_bubble_view.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/scoped_nsobject.h" | 8 #include "base/scoped_nsobject.h" |
9 #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" | 9 #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 glowColor, 0.75, | 85 glowColor, 0.75, |
86 nil]); | 86 nil]); |
87 | 87 |
88 [gradient.get() drawInBezierPath:bezier angle:0.0]; | 88 [gradient.get() drawInBezierPath:bezier angle:0.0]; |
89 } else if (bubbleType_ == kWhiteInfoBubble) { | 89 } else if (bubbleType_ == kWhiteInfoBubble) { |
90 [[NSColor whiteColor] set]; | 90 [[NSColor whiteColor] set]; |
91 [bezier fill]; | 91 [bezier fill]; |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 - (NSPoint)arrowTip { | |
96 NSRect bounds = [self bounds]; | |
97 NSPoint arrowTip = NSMakePoint(NSMaxX(bounds), NSMaxY(bounds)); | |
Scott Hess - ex-Googler
2010/04/05 23:07:16
If kTopLeft, arrowTip.x should be NSMinX(bounds) +
mrossetti
2012/05/14 21:35:09
Done.
| |
98 CGFloat tipXOffset = kBubbleArrowXOffset + kBubbleArrowWidth / 2.0; | |
99 switch (arrowLocation_) { | |
100 case kTopLeft: | |
101 arrowTip.x = tipXOffset; | |
102 break; | |
103 case kTopRight: | |
104 arrowTip.x -= tipXOffset; | |
105 break; | |
106 default: | |
107 NOTREACHED(); | |
108 break; | |
109 } | |
110 return arrowTip; | |
111 } | |
112 | |
95 @end | 113 @end |
OLD | NEW |