Chromium Code Reviews| 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/bubble_decoration.h" | 5 #import "chrome/browser/cocoa/location_bar/bubble_decoration.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "chrome/browser/cocoa/image_utils.h" | 8 #import "chrome/browser/cocoa/image_utils.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 // Padding between the icon/label and bubble edges. | 12 // Padding between the icon/label and bubble edges. |
| 13 const CGFloat kBubblePadding = 7.0; | 13 const CGFloat kBubblePadding = 7.0; |
| 14 | 14 |
| 15 // How far to inset image from boundary rect. | 15 // How far to inset image from boundary rect. |
| 16 const CGFloat kImageInset = 3.0; | 16 const CGFloat kImageInset = 0.0; |
|
John Grabowski
2010/07/15 00:39:38
If inset is now 0, perhaps you can remove this var
Scott Hess - ex-Googler
2010/07/15 04:07:38
OK. I was going to say "What if things change aga
| |
| 17 | 17 |
| 18 // How far to inset the keywork token from sides. | 18 // How far to inset the keywork token from sides. |
| 19 const NSInteger kKeywordYInset = 4; | 19 const NSInteger kKeywordYInset = 4; |
| 20 | 20 |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| 23 BubbleDecoration::BubbleDecoration(NSFont* font) { | 23 BubbleDecoration::BubbleDecoration(NSFont* font) { |
| 24 DCHECK(font); | 24 DCHECK(font); |
| 25 if (font) { | 25 if (font) { |
| 26 NSDictionary* attributes = | 26 NSDictionary* attributes = |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 label_.reset([label copy]); | 107 label_.reset([label copy]); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void BubbleDecoration::SetColors(NSColor* border_color, | 110 void BubbleDecoration::SetColors(NSColor* border_color, |
| 111 NSColor* background_color, | 111 NSColor* background_color, |
| 112 NSColor* text_color) { | 112 NSColor* text_color) { |
| 113 border_color_.reset([border_color retain]); | 113 border_color_.reset([border_color retain]); |
| 114 background_color_.reset([background_color retain]); | 114 background_color_.reset([background_color retain]); |
| 115 text_color_.reset([text_color retain]); | 115 text_color_.reset([text_color retain]); |
| 116 } | 116 } |
| OLD | NEW |