OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" | 7 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" |
8 | 8 |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 gfx::Rect AutocompletePopupViewMac::GetTargetBounds() { | 512 gfx::Rect AutocompletePopupViewMac::GetTargetBounds() { |
513 // Flip the coordinate system before returning. | 513 // Flip the coordinate system before returning. |
514 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; | 514 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
515 NSRect monitorFrame = [screen frame]; | 515 NSRect monitorFrame = [screen frame]; |
516 gfx::Rect bounds(NSRectToCGRect(targetPopupFrame_)); | 516 gfx::Rect bounds(NSRectToCGRect(targetPopupFrame_)); |
517 bounds.set_y(monitorFrame.size.height - bounds.y() - bounds.height()); | 517 bounds.set_y(monitorFrame.size.height - bounds.y() - bounds.height()); |
518 return bounds; | 518 return bounds; |
519 } | 519 } |
520 | 520 |
521 void AutocompletePopupViewMac::SetSelectedLine(size_t line) { | 521 void AutocompletePopupViewMac::SetSelectedLine(size_t line) { |
522 model_->SetSelectedLine(line, false); | 522 model_->SetSelectedLine(line, false, false); |
523 } | 523 } |
524 | 524 |
525 // This is only called by model in SetSelectedLine() after updating | 525 // This is only called by model in SetSelectedLine() after updating |
526 // everything. Popup should already be visible. | 526 // everything. Popup should already be visible. |
527 void AutocompletePopupViewMac::PaintUpdatesNow() { | 527 void AutocompletePopupViewMac::PaintUpdatesNow() { |
528 AutocompleteMatrix* matrix = GetAutocompleteMatrix(); | 528 AutocompleteMatrix* matrix = GetAutocompleteMatrix(); |
529 [matrix selectCellAtRow:model_->selected_line() column:0]; | 529 [matrix selectCellAtRow:model_->selected_line() column:0]; |
530 } | 530 } |
531 | 531 |
532 AutocompletePopupModel* AutocompletePopupViewMac::GetModel() { | 532 AutocompletePopupModel* AutocompletePopupViewMac::GetModel() { |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 bottomRightCornerRadius:kPopupRoundingRadius]; | 827 bottomRightCornerRadius:kPopupRoundingRadius]; |
828 | 828 |
829 // Draw the matrix clipped to our border. | 829 // Draw the matrix clipped to our border. |
830 [NSGraphicsContext saveGraphicsState]; | 830 [NSGraphicsContext saveGraphicsState]; |
831 [path addClip]; | 831 [path addClip]; |
832 [super drawRect:rect]; | 832 [super drawRect:rect]; |
833 [NSGraphicsContext restoreGraphicsState]; | 833 [NSGraphicsContext restoreGraphicsState]; |
834 } | 834 } |
835 | 835 |
836 @end | 836 @end |
OLD | NEW |