Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.mm

Issue 2874923002: Omnibox UI Experiments: Port vertical margin experiment to Cocoa. (Closed)
Patch Set: make constexpr Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 - (NSInteger)highlightedRow { 100 - (NSInteger)highlightedRow {
101 return hoveredIndex_; 101 return hoveredIndex_;
102 } 102 }
103 103
104 - (void)setHighlightedRow:(NSInteger)rowIndex { 104 - (void)setHighlightedRow:(NSInteger)rowIndex {
105 hoveredIndex_ = rowIndex; 105 hoveredIndex_ = rowIndex;
106 } 106 }
107 107
108 - (CGFloat)tableView:(NSTableView*)tableView heightOfRow:(NSInteger)row { 108 - (CGFloat)tableView:(NSTableView*)tableView heightOfRow:(NSInteger)row {
109 CGFloat height = kContentLineHeight; 109 CGFloat height = [OmniboxPopupCell getContentTextHeight];
110 if ([[array_ objectAtIndex:row] isAnswer]) { 110 if ([[array_ objectAtIndex:row] isAnswer]) {
111 OmniboxPopupMatrix* matrix = 111 OmniboxPopupMatrix* matrix =
112 base::mac::ObjCCastStrict<OmniboxPopupMatrix>(tableView); 112 base::mac::ObjCCastStrict<OmniboxPopupMatrix>(tableView);
113 NSRect rowRect = [tableView rectOfColumn:0]; 113 NSRect rowRect = [tableView rectOfColumn:0];
114 OmniboxPopupCellData* cellData = 114 OmniboxPopupCellData* cellData =
115 base::mac::ObjCCastStrict<OmniboxPopupCellData>( 115 base::mac::ObjCCastStrict<OmniboxPopupCellData>(
116 [array_ objectAtIndex:row]); 116 [array_ objectAtIndex:row]);
117 // Subtract any Material Design padding and/or icon. 117 // Subtract any Material Design padding and/or icon.
118 rowRect.size.width = [OmniboxPopupCell getContentAreaWidth:rowRect] - 118 rowRect.size.width = [OmniboxPopupCell getContentAreaWidth:rowRect] -
119 [matrix contentLeftPadding]; 119 [matrix contentLeftPadding];
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 [self selectRowIndex:row]; 314 [self selectRowIndex:row];
315 if (row != -1) { 315 if (row != -1) {
316 DCHECK(observer_); 316 DCHECK(observer_);
317 observer_->OnMatrixRowSelected(self, row); 317 observer_->OnMatrixRowSelected(self, row);
318 return YES; 318 return YES;
319 } 319 }
320 return NO; 320 return NO;
321 } 321 }
322 322
323 @end 323 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698