Chromium Code Reviews| 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( |
|
tapted
2016/06/14 05:51:34
defaultLineHeightForFont has a rounding bug - see
| |
| 156 gfx::Font::NORMAL, | |
| 157 gfx::Font::Weight::NORMAL)]; | |
| 156 } | 158 } |
| 159 | |
| 157 return self; | 160 return self; |
| 158 } | 161 } |
| 159 | 162 |
| 160 - (OmniboxPopupTableController*)controller { | 163 - (OmniboxPopupTableController*)controller { |
| 161 return base::mac::ObjCCastStrict<OmniboxPopupTableController>( | 164 return base::mac::ObjCCastStrict<OmniboxPopupTableController>( |
| 162 [self delegate]); | 165 [self delegate]); |
| 163 } | 166 } |
| 164 | 167 |
| 165 - (void)setObserver:(OmniboxPopupMatrixObserver*)observer { | 168 - (void)setObserver:(OmniboxPopupMatrixObserver*)observer { |
| 166 observer_ = observer; | 169 observer_ = observer; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 [self selectRowIndex:row]; | 301 [self selectRowIndex:row]; |
| 299 if (row != -1) { | 302 if (row != -1) { |
| 300 DCHECK(observer_); | 303 DCHECK(observer_); |
| 301 observer_->OnMatrixRowSelected(self, row); | 304 observer_->OnMatrixRowSelected(self, row); |
| 302 return YES; | 305 return YES; |
| 303 } | 306 } |
| 304 return NO; | 307 return NO; |
| 305 } | 308 } |
| 306 | 309 |
| 307 @end | 310 @end |
| OLD | NEW |