| 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 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h" | 5 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h" | 
| 6 | 6 | 
| 7 #include <cmath> | 7 #include <cmath> | 
| 8 | 8 | 
| 9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" | 
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" | 
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 266   background_rect.size.width = NSWidth(popup_frame); | 266   background_rect.size.width = NSWidth(popup_frame); | 
| 267   background_rect.size.height = NSHeight(popup_frame) - | 267   background_rect.size.height = NSHeight(popup_frame) - | 
| 268       NSHeight(top_separator_frame) - NSHeight(bottom_separator_frame); | 268       NSHeight(top_separator_frame) - NSHeight(bottom_separator_frame); | 
| 269   background_rect.origin.y = NSMaxY(top_separator_frame); | 269   background_rect.origin.y = NSMaxY(top_separator_frame); | 
| 270   [background_view_ setFrame:background_rect]; | 270   [background_view_ setFrame:background_rect]; | 
| 271 | 271 | 
| 272   // Matrix. | 272   // Matrix. | 
| 273   NSRect matrix_frame = NSZeroRect; | 273   NSRect matrix_frame = NSZeroRect; | 
| 274   matrix_frame.origin.x = 0; | 274   matrix_frame.origin.x = 0; | 
| 275   [matrix_ setContentLeftPadding:match_omnibox_width ? 0 : field_origin_base.x]; | 275   [matrix_ setContentLeftPadding:match_omnibox_width ? 0 : field_origin_base.x]; | 
|  | 276   [matrix_ setContentMaxWidth:NSWidth([field_ bounds])]; | 
| 276   matrix_frame.origin.y = PopupPaddingVertical(); | 277   matrix_frame.origin.y = PopupPaddingVertical(); | 
| 277   matrix_frame.size.width = table_width; | 278   matrix_frame.size.width = table_width; | 
| 278   matrix_frame.size.height = matrixHeight; | 279   matrix_frame.size.height = matrixHeight; | 
| 279   [matrix_ setFrame:matrix_frame]; | 280   [matrix_ setFrame:matrix_frame]; | 
| 280   [[[matrix_ tableColumns] objectAtIndex:0] setWidth:table_width]; | 281   [[[matrix_ tableColumns] objectAtIndex:0] setWidth:table_width]; | 
| 281 | 282 | 
| 282   // Don't play animation games on first display. | 283   // Don't play animation games on first display. | 
| 283   target_popup_frame_ = popup_frame; | 284   target_popup_frame_ = popup_frame; | 
| 284   if (![popup_ parentWindow]) { | 285   if (![popup_ parentWindow]) { | 
| 285     DCHECK(![popup_ isVisible]); | 286     DCHECK(![popup_ isVisible]); | 
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 349   return NSImageFromImageSkia( | 350   return NSImageFromImageSkia( | 
| 350       gfx::CreateVectorIcon(vector_icon, kIconSize, icon_color)); | 351       gfx::CreateVectorIcon(vector_icon, kIconSize, icon_color)); | 
| 351 } | 352 } | 
| 352 | 353 | 
| 353 void OmniboxPopupViewMac::OpenURLForRow(size_t row, | 354 void OmniboxPopupViewMac::OpenURLForRow(size_t row, | 
| 354                                         WindowOpenDisposition disposition) { | 355                                         WindowOpenDisposition disposition) { | 
| 355   DCHECK_LT(row, GetResult().size()); | 356   DCHECK_LT(row, GetResult().size()); | 
| 356   omnibox_view_->OpenMatch(GetResult().match_at(row), disposition, GURL(), | 357   omnibox_view_->OpenMatch(GetResult().match_at(row), disposition, GURL(), | 
| 357                            base::string16(), row); | 358                            base::string16(), row); | 
| 358 } | 359 } | 
| OLD | NEW | 
|---|