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/location_bar/ev_bubble_decoration.h" | 5 #import "chrome/browser/cocoa/location_bar/ev_bubble_decoration.h" |
6 | 6 |
7 #include "app/text_elider.h" | 7 #include "app/text_elider.h" |
8 #import "base/logging.h" | 8 #import "base/logging.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #import "chrome/browser/cocoa/image_utils.h" | 10 #import "chrome/browser/cocoa/image_utils.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // Minimum acceptable width for the ev bubble. | 24 // Minimum acceptable width for the ev bubble. |
25 const CGFloat kMinElidedBubbleWidth = 150.0; | 25 const CGFloat kMinElidedBubbleWidth = 150.0; |
26 | 26 |
27 // Maximum amount of available space to make the bubble, subject to | 27 // Maximum amount of available space to make the bubble, subject to |
28 // |kMinElidedBubbleWidth|. | 28 // |kMinElidedBubbleWidth|. |
29 const float kMaxBubbleFraction = 0.5; | 29 const float kMaxBubbleFraction = 0.5; |
30 | 30 |
31 // TODO(shess): This is ugly, find a better way. Using it right now | 31 // TODO(shess): This is ugly, find a better way. Using it right now |
32 // so that I can crib from gtk and still be able to see that I'm using | 32 // so that I can crib from gtk and still be able to see that I'm using |
33 // the same values easily. | 33 // the same values easily. |
34 const NSColor* ColorWithRGBBytes(int rr, int gg, int bb) { | 34 NSColor* ColorWithRGBBytes(int rr, int gg, int bb) { |
35 DCHECK_LE(rr, 255); | 35 DCHECK_LE(rr, 255); |
36 DCHECK_LE(bb, 255); | 36 DCHECK_LE(bb, 255); |
37 DCHECK_LE(gg, 255); | 37 DCHECK_LE(gg, 255); |
38 return [NSColor colorWithCalibratedRed:static_cast<float>(rr)/255.0 | 38 return [NSColor colorWithCalibratedRed:static_cast<float>(rr)/255.0 |
39 green:static_cast<float>(gg)/255.0 | 39 green:static_cast<float>(gg)/255.0 |
40 blue:static_cast<float>(bb)/255.0 | 40 blue:static_cast<float>(bb)/255.0 |
41 alpha:1.0]; | 41 alpha:1.0]; |
42 } | 42 } |
43 | 43 |
44 } // namespace | 44 } // namespace |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return location_icon_->GetDragPasteboard(); | 98 return location_icon_->GetDragPasteboard(); |
99 } | 99 } |
100 | 100 |
101 NSImage* EVBubbleDecoration::GetDragImage() { | 101 NSImage* EVBubbleDecoration::GetDragImage() { |
102 return location_icon_->GetDragImage(); | 102 return location_icon_->GetDragImage(); |
103 } | 103 } |
104 | 104 |
105 bool EVBubbleDecoration::OnMousePressed(NSRect frame) { | 105 bool EVBubbleDecoration::OnMousePressed(NSRect frame) { |
106 return location_icon_->OnMousePressed(frame); | 106 return location_icon_->OnMousePressed(frame); |
107 } | 107 } |
OLD | NEW |