| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 OmniboxPopupViewMac::BackgroundColor(hasDarkTheme_); | 145 OmniboxPopupViewMac::BackgroundColor(hasDarkTheme_); |
| 146 [self setBackgroundColor:backgroundColor]; | 146 [self setBackgroundColor:backgroundColor]; |
| 147 [self setAllowsEmptySelection:YES]; | 147 [self setAllowsEmptySelection:YES]; |
| 148 [self deselectAll:self]; | 148 [self deselectAll:self]; |
| 149 | 149 |
| 150 [self resetTrackingArea]; | 150 [self resetTrackingArea]; |
| 151 | 151 |
| 152 base::scoped_nsobject<NSLayoutManager> layoutManager( | 152 base::scoped_nsobject<NSLayoutManager> layoutManager( |
| 153 [[NSLayoutManager alloc] init]); | 153 [[NSLayoutManager alloc] init]); |
| 154 answerLineHeight_ = | 154 answerLineHeight_ = |
| 155 [layoutManager defaultLineHeightForFont:OmniboxViewMac::GetLargeFont( | 155 [layoutManager defaultLineHeightForFont:OmniboxViewMac::GetLargeFont()]; |
| 156 gfx::Font::NORMAL)]; | |
| 157 } | 156 } |
| 158 return self; | 157 return self; |
| 159 } | 158 } |
| 160 | 159 |
| 161 - (OmniboxPopupTableController*)controller { | 160 - (OmniboxPopupTableController*)controller { |
| 162 return base::mac::ObjCCastStrict<OmniboxPopupTableController>( | 161 return base::mac::ObjCCastStrict<OmniboxPopupTableController>( |
| 163 [self delegate]); | 162 [self delegate]); |
| 164 } | 163 } |
| 165 | 164 |
| 166 - (void)setObserver:(OmniboxPopupMatrixObserver*)observer { | 165 - (void)setObserver:(OmniboxPopupMatrixObserver*)observer { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 [self selectRowIndex:row]; | 298 [self selectRowIndex:row]; |
| 300 if (row != -1) { | 299 if (row != -1) { |
| 301 DCHECK(observer_); | 300 DCHECK(observer_); |
| 302 observer_->OnMatrixRowSelected(self, row); | 301 observer_->OnMatrixRowSelected(self, row); |
| 303 return YES; | 302 return YES; |
| 304 } | 303 } |
| 305 return NO; | 304 return NO; |
| 306 } | 305 } |
| 307 | 306 |
| 308 @end | 307 @end |
| OLD | NEW |