| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 OmniboxPopupMatrix* matrix() { return matrix_; } | 51 OmniboxPopupMatrix* matrix() { return matrix_; } |
| 52 | 52 |
| 53 // Return the text to show for the match, based on the match's | 53 // Return the text to show for the match, based on the match's |
| 54 // contents and description. Result will be in |font|, with the | 54 // contents and description. Result will be in |font|, with the |
| 55 // boldfaced version used for matches. | 55 // boldfaced version used for matches. |
| 56 static NSAttributedString* MatchText(const AutocompleteMatch& match, | 56 static NSAttributedString* MatchText(const AutocompleteMatch& match, |
| 57 gfx::Font& font, | 57 gfx::Font& font, |
| 58 float cell_width); | 58 float cell_width); |
| 59 | 59 |
| 60 static NSMutableAttributedString* CreateAttributedString( |
| 61 const base::string16& match_string, |
| 62 NSColor* text_color, |
| 63 gfx::Font& font); |
| 64 |
| 60 // Applies the given font and colors to the match string based on | 65 // Applies the given font and colors to the match string based on |
| 61 // classifications. | 66 // classifications. |
| 62 static NSMutableAttributedString* DecorateMatchedString( | 67 static NSMutableAttributedString* DecorateMatchedString( |
| 63 const base::string16& match_string, | 68 const base::string16& match_string, |
| 64 const AutocompleteMatch::ACMatchClassifications& classifications, | 69 const AutocompleteMatch::ACMatchClassifications& classifications, |
| 65 NSColor* text_color, | 70 NSColor* text_color, |
| 66 NSColor* dim_text_color, | 71 NSColor* dim_text_color, |
| 67 gfx::Font& font); | 72 gfx::Font& font); |
| 68 | 73 |
| 69 // Helper for MatchText() to elide a marked-up string using | 74 // Helper for MatchText() to elide a marked-up string using |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 116 |
| 112 base::scoped_nsobject<OmniboxPopupMatrix> matrix_; | 117 base::scoped_nsobject<OmniboxPopupMatrix> matrix_; |
| 113 base::scoped_nsobject<NSView> top_separator_view_; | 118 base::scoped_nsobject<NSView> top_separator_view_; |
| 114 base::scoped_nsobject<NSView> bottom_separator_view_; | 119 base::scoped_nsobject<NSView> bottom_separator_view_; |
| 115 base::scoped_nsobject<NSBox> background_view_; | 120 base::scoped_nsobject<NSBox> background_view_; |
| 116 | 121 |
| 117 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupViewMac); | 122 DISALLOW_COPY_AND_ASSIGN(OmniboxPopupViewMac); |
| 118 }; | 123 }; |
| 119 | 124 |
| 120 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ | 125 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_POPUP_VIEW_MAC_H_ |
| OLD | NEW |