OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/cocoa/omnibox/omnibox_popup_matrix.h" | 5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
9 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" | 9 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" |
10 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h" | 10 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 [self setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleNone]; | 134 [self setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleNone]; |
135 [self setBackgroundColor:[NSColor controlBackgroundColor]]; | 135 [self setBackgroundColor:[NSColor controlBackgroundColor]]; |
136 [self setAllowsEmptySelection:YES]; | 136 [self setAllowsEmptySelection:YES]; |
137 [self deselectAll:self]; | 137 [self deselectAll:self]; |
138 | 138 |
139 [self resetTrackingArea]; | 139 [self resetTrackingArea]; |
140 | 140 |
141 base::scoped_nsobject<NSLayoutManager> layoutManager( | 141 base::scoped_nsobject<NSLayoutManager> layoutManager( |
142 [[NSLayoutManager alloc] init]); | 142 [[NSLayoutManager alloc] init]); |
143 answerLineHeight_ = | 143 answerLineHeight_ = |
144 [layoutManager defaultLineHeightForFont:OmniboxViewMac::GetLargeFont( | 144 [layoutManager defaultLineHeightForFont:OmniboxViewMac::GetLargeFont()]; |
145 gfx::Font::NORMAL)]; | |
146 } | 145 } |
147 return self; | 146 return self; |
148 } | 147 } |
149 | 148 |
150 - (OmniboxPopupTableController*)controller { | 149 - (OmniboxPopupTableController*)controller { |
151 return base::mac::ObjCCastStrict<OmniboxPopupTableController>( | 150 return base::mac::ObjCCastStrict<OmniboxPopupTableController>( |
152 [self delegate]); | 151 [self delegate]); |
153 } | 152 } |
154 | 153 |
155 - (void)setObserver:(OmniboxPopupMatrixObserver*)observer { | 154 - (void)setObserver:(OmniboxPopupMatrixObserver*)observer { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 [self selectRowIndex:row]; | 287 [self selectRowIndex:row]; |
289 if (row != -1) { | 288 if (row != -1) { |
290 DCHECK(observer_); | 289 DCHECK(observer_); |
291 observer_->OnMatrixRowSelected(self, row); | 290 observer_->OnMatrixRowSelected(self, row); |
292 return YES; | 291 return YES; |
293 } | 292 } |
294 return NO; | 293 return NO; |
295 } | 294 } |
296 | 295 |
297 @end | 296 @end |
OLD | NEW |