| 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 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" | 5 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "app/text_elider.h" | 8 #include "app/text_elider.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 10 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 NSColor* BackgroundColor() { | 68 NSColor* BackgroundColor() { |
| 69 return [[NSColor controlBackgroundColor] colorWithAlphaComponent:kPopupAlpha]; | 69 return [[NSColor controlBackgroundColor] colorWithAlphaComponent:kPopupAlpha]; |
| 70 } | 70 } |
| 71 NSColor* SelectedBackgroundColor() { | 71 NSColor* SelectedBackgroundColor() { |
| 72 return [[NSColor selectedControlColor] colorWithAlphaComponent:kPopupAlpha]; | 72 return [[NSColor selectedControlColor] colorWithAlphaComponent:kPopupAlpha]; |
| 73 } | 73 } |
| 74 NSColor* HoveredBackgroundColor() { | 74 NSColor* HoveredBackgroundColor() { |
| 75 return [[NSColor controlHighlightColor] colorWithAlphaComponent:kPopupAlpha]; | 75 return [[NSColor controlHighlightColor] colorWithAlphaComponent:kPopupAlpha]; |
| 76 } | 76 } |
| 77 | 77 |
| 78 static const NSColor* ContentTextColor() { | 78 static NSColor* ContentTextColor() { |
| 79 return [NSColor blackColor]; | 79 return [NSColor blackColor]; |
| 80 } | 80 } |
| 81 static const NSColor* URLTextColor() { | 81 static NSColor* URLTextColor() { |
| 82 return [NSColor colorWithCalibratedRed:0.0 green:0.55 blue:0.0 alpha:1.0]; | 82 return [NSColor colorWithCalibratedRed:0.0 green:0.55 blue:0.0 alpha:1.0]; |
| 83 } | 83 } |
| 84 static const NSColor* DescriptionTextColor() { | 84 static NSColor* DescriptionTextColor() { |
| 85 return [NSColor darkGrayColor]; | 85 return [NSColor darkGrayColor]; |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace | 88 } // namespace |
| 89 | 89 |
| 90 // Helper for MatchText() to allow sharing code between the contents | 90 // Helper for MatchText() to allow sharing code between the contents |
| 91 // and description cases. Returns NSMutableAttributedString as a | 91 // and description cases. Returns NSMutableAttributedString as a |
| 92 // convenience for MatchText(). | 92 // convenience for MatchText(). |
| 93 NSMutableAttributedString* AutocompletePopupViewMac::DecorateMatchedString( | 93 NSMutableAttributedString* AutocompletePopupViewMac::DecorateMatchedString( |
| 94 const std::wstring &matchString, | 94 const std::wstring &matchString, |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 bottomRightCornerRadius:0.0]; | 699 bottomRightCornerRadius:0.0]; |
| 700 | 700 |
| 701 // Draw the matrix clipped to our border. | 701 // Draw the matrix clipped to our border. |
| 702 [NSGraphicsContext saveGraphicsState]; | 702 [NSGraphicsContext saveGraphicsState]; |
| 703 [path addClip]; | 703 [path addClip]; |
| 704 [super drawRect:rect]; | 704 [super drawRect:rect]; |
| 705 [NSGraphicsContext restoreGraphicsState]; | 705 [NSGraphicsContext restoreGraphicsState]; |
| 706 } | 706 } |
| 707 | 707 |
| 708 @end | 708 @end |
| OLD | NEW |